From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20852: 24.3; update-file-autoloads doesn't accept unescaped parenthesis character literal Date: Thu, 02 Jul 2015 11:50:53 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435852343 16416 80.91.229.3 (2 Jul 2015 15:52:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jul 2015 15:52:23 +0000 (UTC) Cc: 20852@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 02 17:52:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZAgmZ-0007i3-Mb for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jul 2015 17:52:11 +0200 Original-Received: from localhost ([::1]:37276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAgmY-0004L1-Pm for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jul 2015 11:52:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAgmU-0004Kt-Od for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2015 11:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAgmQ-0000gh-IC for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2015 11:52:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAgmQ-0000gb-FC for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2015 11:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZAgmQ-0006jb-6R for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2015 11:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jul 2015 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug wontfix Original-Received: via spool by 20852-submit@debbugs.gnu.org id=B20852.143585226625822 (code B ref 20852); Thu, 02 Jul 2015 15:52:02 +0000 Original-Received: (at 20852) by debbugs.gnu.org; 2 Jul 2015 15:51:06 +0000 Original-Received: from localhost ([127.0.0.1]:37837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAglU-0006iM-CU for submit@debbugs.gnu.org; Thu, 02 Jul 2015 11:51:05 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:43863) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAglQ-0006hh-0t for 20852@debbugs.gnu.org; Thu, 02 Jul 2015 11:51:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYDQA731xV/2cGNJ1cgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBAQUBAQEBAR2KOIEChQUHhC0FnxeGaYctg36DWSOCChwVgVkigngBAQE X-IPAS-Result: A0CYDQA731xV/2cGNJ1cgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBAQUBAQEBAR2KOIEChQUHhC0FnxeGaYctg36DWSOCChwVgVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="129061317" Original-Received: from 157-52-6-103.cpe.teksavvy.com (HELO pastel.home) ([157.52.6.103]) by ironport2-out.teksavvy.com with ESMTP; 02 Jul 2015 11:50:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id CB28F6165D; Thu, 2 Jul 2015 11:50:53 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Tue, 30 Jun 2015 20:43:01 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104623 Archived-At: > I've attached a patch that uses the same mechanism as the check for > old-style backquotes. Looks pretty good, thank you. A few comments and nitpicks: > +static void > +load_warn_unescaped_character_literals (Lisp_Object file) { > + if (!NILP (Vunescaped_character_literals)) > + { > + AUTO_STRING (format, "Loading `%s': unescaped parenthesis character literals detected!"); > + CALLN (Fmessage, format, file); > + } > +} It would be even better to show the actual unescaped character literal(s). Either just displaying one of the chars, or displaying them all. > if (c == ' ' || c == '\t') > return make_number (c); > > + if (c == '(' || c == ')') > + Vunescaped_character_literals = Qt; I think we want to emit the same warning for several other chars, at least ';', '"', '[', and ']' (we could also include ' ' and '\t', tho I'm not sure it's worth the trouble. If/when we want to do that, we'd want to do it not just for ? and ? but also for ?\ and ?\ and recommend the use of ?\s and ?\t instead). > DEFSYM (Qold_style_backquotes, "old-style-backquotes"); > + DEFSYM (Qunescaped_character_literals, "unescaped-character-literals"); I think "old-style-backquotes" was a bad choice. It should have been "read--found-old-style-backquotes" or something along these lines. AFAIK this variable is only used internally, so we can rename it without any extra precautions. If you could do that in your patch, that'd be great. One more thing: old-style-backquotes is not only used by `load' but also by the byte-compiler. So take a look at bytecomp.el where you'll probably want to add similar code for your unescaped-character-literals. Stefan