From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tetsurou Okazaki Newsgroups: gmane.emacs.bugs Subject: bug#6490: 24.0.50; src/lread.c: old style backquote bug? Date: Thu, 01 Jul 2010 14:41:49 +0900 Message-ID: <8639w3vjvm.wl%%cc9230e4f6b11649d75e8c3813911dbe1dd37419@be.to> References: <86iq5bifzr.wl%%cc9230e4f6b11649d75e8c3813911dbe1dd37419@be.to> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Thu_Jul__1_14:41:48_2010-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277963991 8642 80.91.229.12 (1 Jul 2010 05:59:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Jul 2010 05:59:51 +0000 (UTC) Cc: Tetsurou Okazaki , 6490@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 01 07:59:50 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OUCoN-0002YG-Hx for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jul 2010 07:59:47 +0200 Original-Received: from localhost ([127.0.0.1]:49977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUCoN-0006eu-3l for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jul 2010 01:59:47 -0400 Original-Received: from [140.186.70.92] (port=32937 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUCo7-0006Xv-6e for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2010 01:59:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUCo5-000496-7A for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2010 01:59:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33862) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUCo5-000490-5A for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2010 01:59:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OUCY9-0007mG-MM; Thu, 01 Jul 2010 01:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tetsurou Okazaki Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2010 05:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 6490-submit@debbugs.gnu.org id=B6490.127796292629885 (code B ref 6490); Thu, 01 Jul 2010 05:43:01 +0000 Original-Received: (at 6490) by debbugs.gnu.org; 1 Jul 2010 05:42:06 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUCXG-0007ly-H2 for submit@debbugs.gnu.org; Thu, 01 Jul 2010 01:42:06 -0400 Original-Received: from post1.infonia.net ([211.13.218.225]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUCXE-0007lb-0W for 6490@debbugs.gnu.org; Thu, 01 Jul 2010 01:42:05 -0400 Original-Received: from zeroset.be.to (actkyo099200.adsl.ppp.infoweb.ne.jp [219.116.249.200]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by post1.infonia.net (Postfix) with ESMTP id 0400612A49; Thu, 1 Jul 2010 14:41:59 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 01 Jul 2010 01:43:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38163 Archived-At: --Multipart_Thu_Jul__1_14:41:48_2010-1 Content-Type: text/plain; charset=US-ASCII At Wed, 23 Jun 2010 00:23:15 +0200, Stefan Monnier wrote: > > > Attached patch for Emacs fixes this error. > > I'm glad the patch fixes things for you, since this patch indeed looks > perfectly harmless, but I'm a bit puzzled because it doesn't just look > harmless: it looks to me like the patch does change anything to the way > the code works. So could you explain to me how&why the patch fixes > the problem? I'm probably just overlooking some "obvious" detail, The changes committed in rev:100605 reassigns the next character to the variable `c'. When the next character is SPC (32, #o40, #x20), old style backquote is detected. if (first_in_list && (c = READCHAR, UNREAD (c), c == ' ')) { Vold_style_backquotes = Qt; goto default_label; } But backquote handling is skipped because `c' is SPC. default_label: if (c <= 040) goto retry; ... old style backquote handling ... My patch avoids reassignment of `c' not to skip old style backquote handling. To keep more compatibility with released Emacs, it is preferable to allow a character such as \r or \n after the old style backquote. --Multipart_Thu_Jul__1_14:41:48_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="src-lread-old-backquote2.diff" === modified file 'src/lread.c' --- src/lread.c 2010-06-16 14:10:02 +0000 +++ src/lread.c 2010-06-27 11:48:20 +0000 @@ -2693,21 +2693,26 @@ old-style. For Emacs-25, we should completely remove this first_in_list exception (old-style can still be obtained via "(\`" anyway). */ - if (first_in_list && (c = READCHAR, UNREAD (c), c == ' ')) - { - Vold_style_backquotes = Qt; - goto default_label; - } - else - { - Lisp_Object value; - - new_backquote_flag++; - value = read0 (readcharfun); - new_backquote_flag--; - - return Fcons (Qbackquote, Fcons (value, Qnil)); - } + { + int ch = READCHAR; + UNREAD (ch); + + if (first_in_list && (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || ch == '\f')) + { + Vold_style_backquotes = Qt; + goto default_label; + } + else + { + Lisp_Object value; + + new_backquote_flag++; + value = read0 (readcharfun); + new_backquote_flag--; + + return Fcons (Qbackquote, Fcons (value, Qnil)); + } + } case ',': if (new_backquote_flag) --Multipart_Thu_Jul__1_14:41:48_2010-1--