From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: xah lee , 1406@debbugs.gnu.org Resent-From: xah lee Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 21 Nov 2008 21:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122730266611840 (code B ref -1); Fri, 21 Nov 2008 21:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.2 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Nov 2008 21:24:26 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALLOM54011832 for ; Fri, 21 Nov 2008 13:24:23 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3dUE-0008Jr-3z for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3dUD-0008Jc-EF for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from [199.232.76.173] (port=45623 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3dUD-0008JZ-9B for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from mout.perfora.net ([74.208.4.195]:57631) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3dUC-0004pZ-Pc for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3dUB0XsF-0001Ng; Fri, 21 Nov 2008 16:24:20 -0500 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: quoted-printable Message-Id: Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: xah lee Date: Fri, 21 Nov 2008 13:24:30 -0800 X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX1/w83bqmdYxLJzeG831v02NgAt19l8Yg7QYFhy ikTctdMkiNtrgD29kbJ2LzxxSV7FGwYBRISQRw3ypuVl2XqV1c 2oH7Gmfq1YnzUyatVxCQw== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) This appears to be a bug of backward-up-list. Summary: when i do backward-up-list in a particular lisp file, when =20 the cursor is inside a double quote, it tell me Unbalanced =20 parentheses, but there does not seems to be any unbalanced paren. The =20= file byte-compiles fine. steps to reproduce: Save the following function to a file. (defun replace-keybinding-notation (p1 p2) "Do a bunch of find/replace on current text selection." (interactive "r") (let (mystr (case-fold-search nil) (case-replace nil)) (setq mystr (buffer-substring p1 p2)) (setq mystr (with-temp-buffer (insert mystr) ;; C- (goto-char (point-min)) (while (search-forward-regexp "C-" nil t) (replace-match "Ctlr+" t) ) ;; M- (goto-char (point-min)) (while (search-forward-regexp "M-" nil t) (replace-match "Alt+" t) ) ;; Ctrl+Alt+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+Alt\\+\\([[:graph:]]\=20 \)" nil t) (replace-match "Ctrl+Alt+\=20= \1" t) ) ;; Cmd+Shift+t (goto-char (point-min)) (while (search-forward-regexp "Cmd\\+Shift\\+\\([[:graph:]]\=20= \)" nil t) (replace-match "Cmd+Shift+\=20= \1" t) ) ;; Alt+Shift+t (goto-char (point-min)) (while (search-forward-regexp "Alt\\+Shift\\+\\([[:graph:]]\=20= \)" nil t) (replace-match "Alt+Shift+\=20= \1" t) ) ;; Ctrl+t Ctrl+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\) Ctrl=20= \\+\\([[:graph:]]\\)" nil t) (replace-match "Ctrl+\\1 Ctrl+\\2" t) ) ;; Ctrl+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\)" =20 nil t) (replace-match "Ctrl+\\1" t) ) ;; Alt+t (goto-char (point-min)) (while (search-forward-regexp "Alt\\+\\([[:graph:]]\\)" nil t) (replace-match "Alt+\\1" t) ) ;; Meta+t (goto-char (point-min)) (while (search-forward-regexp "Meta\\+\\([[:graph:]]\\)" =20 nil t) (replace-match "Meta+\\1" t) ) ;; Cmd+t (goto-char (point-min)) (while (search-forward-regexp "Cmd\\+\\([[:graph:]]\\)" nil t) (replace-match "Cmd+\\1" t) ) (buffer-string) ) ) (delete-region p1 p2) (insert mystr) ) ) =E2=80=A2 start emacs by /Applications/Emacs.app/Contents/MacOS/Emacs -q =E2=80=A2 open the file. =E2=80=A2 interactive search for =E2=80=9CM-=E2=80=9D, do it twice so = that your cursor =20 is in between the double quote on the line: (search-forward-regexp =20 "M-" nil t). Press return so that your cursor is just before the =20 closing quote. =E2=80=A2 press Ctrl+Alt+=E2=86=91 (invoke backward-up-list). =E2=80=A2 emacs says: =E2=80=9Cup-list: Scan error: "Unbalanced = parentheses", 582, =20 1=E2=80=9D --------------------------------- In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp Windowing system distributor `Apple Inc.', version 10.4.11 configured using `configure '--prefix=3D/Applications/Emacs.app/=20 Contents/Resources' '--with-carbon' '--without-x' '--libexecdir=3D/=20 Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' 'CFLAGS=3D-Os -arch =20 i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DUSE_ATSUI -=20= DUSE_MAC_TSM'' Xah =E2=88=91 http://xahlee.org/ =E2=98=84= From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: Acknowledgement (backward-up-list reports scan error incorrectly?) Reply-To: xah lee , 1406@debbugs.gnu.org Resent-From: xah lee Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 21 Nov 2008 21:45:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1406-submit@emacsbugs.donarmstrong.com id=B1406.122730358715653 (code B ref 1406); Fri, 21 Nov 2008 21:45:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, SPF_HELO_PASS autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1406) by emacsbugs.donarmstrong.com; 21 Nov 2008 21:39:47 +0000 Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALLdiqO015647 for <1406@emacsbugs.donarmstrong.com>; Fri, 21 Nov 2008 13:39:45 -0800 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3dj42P8v-0001Tx; Fri, 21 Nov 2008 16:39:43 -0500 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: References: Content-Type: text/plain; charset=UTF-8; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: xah lee Date: Fri, 21 Nov 2008 13:39:56 -0800 To: 1406@debbugs.gnu.org X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX1+1PwIknKd86Pb8GjhgaXKyGR09R7/vEoxRbWr 0xCat7DwlcImWBTeHKpLeb3U9qY+VT4Z/BsTPCwcKyCsgns3jH lYx8OgemjeORLsS8cG48w== addendum: the problem does not occur if you switch to text-mode. It occur if you switch to emacs-lisp-mode or fundamental-mode. (so, the bug seems having to do with syntax table) Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 21, 2008, at 1:30 PM, Emacs bug Tracking System wrote: Thank you for filing a new bug report with Emacs. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Emacs Bugs If you wish to submit further information on this problem, please send it to 1406@debbugs.gnu.org, as before. Please do not send mail to help-debbugs@gnu.org unless you wish to report a problem with the Bug-tracking system. --=20 1406: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1406 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems =E2=98=84 From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: Alan Mackenzie , 1406@debbugs.gnu.org Resent-From: Alan Mackenzie Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 21 Nov 2008 23:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12273088237698 (code B ref -1); Fri, 21 Nov 2008 23:15:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.9 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Nov 2008 23:07:03 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALN70Tc007687 for ; Fri, 21 Nov 2008 15:07:01 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3f5Y-0000Uh-An for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:07:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3f5X-0000UQ-LX for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:07:00 -0500 Received: from [199.232.76.173] (port=34589 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3f5X-0000UL-Gr for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:06:59 -0500 Received: from colin.muc.de ([193.149.48.1]:3468 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3f5X-0003TH-69 for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:06:59 -0500 Received: (qmail 15432 invoked by uid 3782); 21 Nov 2008 23:06:57 -0000 Received: from acm.muc.de (pD9E52D53.dip.t-dialin.net [217.229.45.83]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 22 Nov 2008 00:06:54 +0100 Received: (qmail 9541 invoked by uid 1000); 21 Nov 2008 23:19:44 -0000 Date: Fri, 21 Nov 2008 23:19:44 +0000 To: xah lee , 1406@debbugs.gnu.org Cc: bug-gnu-emacs@gnu.org Message-ID: <20081121231944.GB2089@muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 'Evening, Xah! On Fri, Nov 21, 2008 at 01:24:30PM -0800, xah lee wrote: > This appears to be a bug of backward-up-list. > Summary: when i do backward-up-list in a particular lisp file, when > the cursor is inside a double quote, it tell me Unbalanced > parentheses, but there does not seems to be any unbalanced paren. The > file byte-compiles fine. What do you mean, "the cursor is inside a double quote"? Functions like backward-up-list don't know whether or not they start inside a string or comment; the only way they could find out would be by doing a partial-parse-sexp from some "safe" position earlier on in the file. So these functions assume they're NOT in a string or comment. backward-up-list moves back to the quote mark, and tries to jump over the "string it's just found", possibly taking it to the beginning of the buffer. The bug appears to be in the doc string of the function, which forgets to mention this assumption. If you really, really, need a function which works the way you've pictured, it's not too difficult to write. But it will be SLOW, SLOW, SLOW. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: xah lee , 1406@debbugs.gnu.org Resent-From: xah lee Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 21 Nov 2008 23:35:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122730996312788 (code B ref -1); Fri, 21 Nov 2008 23:35:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.7 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Nov 2008 23:26:03 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALNPx9r012782 for ; Fri, 21 Nov 2008 15:26:00 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3fNv-0008GN-47 for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:25:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3fNt-0008EU-FV for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:25:58 -0500 Received: from [199.232.76.173] (port=33731 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3fNt-0008EO-As for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:25:57 -0500 Received: from mout.perfora.net ([74.208.4.197]:60344) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3fNt-0004gm-8i for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 18:25:57 -0500 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3fNj0UmN-0001Bg; Fri, 21 Nov 2008 18:25:50 -0500 In-Reply-To: <20081121231944.GB2089@muc.de> References: <20081121231944.GB2089@muc.de> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> Cc: 1406@debbugs.gnu.org, bug-gnu-emacs@gnu.org Content-Transfer-Encoding: quoted-printable From: xah lee Date: Fri, 21 Nov 2008 15:26:03 -0800 To: Alan Mackenzie X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX183G075W+ZEtiXCuUwPOm5Sx6poqlfrMLjRVyP efjYuN0L/zJ2LN/PH9LvX6HwMZXTG6Pv7MJ4UKD4bWcq7OC3w1 AQs2xuhTq6zoHCnDDRXag== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) X-CrossAssassin-Score: 2 Hi Alan, it works if you switch to text mode though. It doesn't work while in emacs-lisp-mode and fundamental mode. In any case, normally it works when inside string too. Just not in =20 this particular case. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 21, 2008, at 3:19 PM, Alan Mackenzie wrote: 'Evening, Xah! On Fri, Nov 21, 2008 at 01:24:30PM -0800, xah lee wrote: > This appears to be a bug of backward-up-list. > Summary: when i do backward-up-list in a particular lisp file, when > the cursor is inside a double quote, it tell me Unbalanced > parentheses, but there does not seems to be any unbalanced paren. The > file byte-compiles fine. What do you mean, "the cursor is inside a double quote"? Functions like backward-up-list don't know whether or not they start inside a string or comment; the only way they could find out would be by doing a partial-parse-sexp from some "safe" position earlier on in the file. So these functions assume they're NOT in a string or comment. backward-up-list moves back to the quote mark, and tries to jump over =20= the "string it's just found", possibly taking it to the beginning of the buffer. The bug appears to be in the doc string of the function, which =20 forgets to mention this assumption. If you really, really, need a function which works the way you've pictured, it's not too difficult to write. But it will be SLOW, SLOW, SLOW. --=20 Alan Mackenzie (Nuremberg, Germany). =E2=98=84 From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: Alan Mackenzie , 1406@debbugs.gnu.org Resent-From: Alan Mackenzie Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 22 Nov 2008 12:30:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122735664523112 (code B ref -1); Sat, 22 Nov 2008 12:30:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Nov 2008 12:24:05 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMCO21N023105 for ; Sat, 22 Nov 2008 04:24:03 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3rWr-0000iE-Is for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:24:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3rWp-0000gk-Qn for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:24:00 -0500 Received: from [199.232.76.173] (port=58209 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3rWp-0000gY-Im for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:23:59 -0500 Received: from colin.muc.de ([193.149.48.1]:4465 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3rWp-0003Et-3k for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:23:59 -0500 Received: (qmail 4001 invoked by uid 3782); 22 Nov 2008 12:23:54 -0000 Received: from acm.muc.de (pD9E532CC.dip.t-dialin.net [217.229.50.204]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 22 Nov 2008 13:23:52 +0100 Received: (qmail 4255 invoked by uid 1000); 22 Nov 2008 12:36:45 -0000 Date: Sat, 22 Nov 2008 12:36:45 +0000 To: xah lee Cc: 1406@debbugs.gnu.org, bug-gnu-emacs@gnu.org Message-ID: <20081122123644.GA3330@muc.de> References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 Hi, Xah! On Fri, Nov 21, 2008 at 03:26:03PM -0800, xah lee wrote: > Hi Alan, > it works if you switch to text mode though. > It doesn't work while in emacs-lisp-mode and fundamental mode. > In any case, normally it works when inside string too. Just not in > this particular case. OK, I think half of the problem here is your prolixity, the other half is my prolixity. :-) Try instead the following example: (defun foo (arg) "foo does nothing." (interactive "P")) Put point inside "P", and do C-M-u `backward-up-list'. You get the error. Now modify the above function by inserting an open paren into the doc string, (defun foo (arg) "foo does nothing. (" (interactive "P")) , and do the same again. It finds that paren. Why? Because backward-up-list assumes its starting point is NOT in a string. It jumps backwards over (what it thinks is) the string "\n(interactive " , and then finds the ?\(. This is exactly what is happening in your somewhat larger example. In text mode, presumably the syntax table doesn't define ?\" as a string quote. In fundamental mode, presumably it does. "(syntax-after (point))" is your friend here. > Xah -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: xah lee , 1406@debbugs.gnu.org Resent-From: xah lee Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 22 Nov 2008 13:00:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122735841630435 (code B ref -1); Sat, 22 Nov 2008 13:00:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.8 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Nov 2008 12:53:36 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMCrXQ7030424 for ; Sat, 22 Nov 2008 04:53:34 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3rzR-00043V-Bq for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:53:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3rzP-00043J-Qb for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:53:33 -0500 Received: from [199.232.76.173] (port=58311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3rzP-00043G-Nj for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:53:31 -0500 Received: from mout.perfora.net ([74.208.4.194]:53257) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3rzP-0004hU-Aa for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 07:53:31 -0500 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3rzK0BjG-0001AH; Sat, 22 Nov 2008 07:53:30 -0500 In-Reply-To: <20081122123644.GA3330@muc.de> References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> <20081122123644.GA3330@muc.de> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> Cc: 1406@debbugs.gnu.org, bug-gnu-emacs@gnu.org Content-Transfer-Encoding: quoted-printable From: xah lee Date: Sat, 22 Nov 2008 04:53:57 -0800 To: Alan Mackenzie X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX1+OM1JZsi1s3E9iZqlfjl062158Ji/7ioj8uMn hB50uFxqiBm7DhesI8kDnWNuy3Ytp65GC+UIis03d2oB0pWLow 9W5GV+NHmwabIcHl1yLPg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 hi Alan, > (defun foo (arg) > "foo does nothing." > (interactive "P")) > > Put point inside "P", and do C-M-u `backward-up-list'. You get the > error. i couldn't duplicate this. It seems to work for me. am using GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) =20 of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp i tried aquamacs. I can duplicate it with -Q, but not with -q. Now i try carbon emacs again with -q, and i _can_ duplicate it. ... umm... not sure what is the problem now... since i'm pretty sure =20 i don't have any customization for emacs-lisp-mode ... am kinda tired now. Maybe i'll do some more testing to see what i =20 find out. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 22, 2008, at 4:36 AM, Alan Mackenzie wrote: Hi, Xah! On Fri, Nov 21, 2008 at 03:26:03PM -0800, xah lee wrote: > Hi Alan, > it works if you switch to text mode though. > It doesn't work while in emacs-lisp-mode and fundamental mode. > In any case, normally it works when inside string too. Just not in > this particular case. OK, I think half of the problem here is your prolixity, the other half is my prolixity. :-) Try instead the following example: (defun foo (arg) "foo does nothing." (interactive "P")) Put point inside "P", and do C-M-u `backward-up-list'. You get the error. Now modify the above function by inserting an open paren into the doc string, (defun foo (arg) "foo does nothing. (" (interactive "P")) , and do the same again. It finds that paren. Why? Because backward-up-list assumes its starting point is NOT in a string. It jumps backwards over (what it thinks is) the string "\n(interactive " , and then finds the ?\(. This is exactly what is happening in your somewhat larger example. In text mode, presumably the syntax table doesn't define ?\" as a string quote. In fundamental mode, presumably it does. "(syntax-after (point))" is your friend here. > Xah --=20 Alan Mackenzie (Nuremberg, Germany). =E2=98=84 From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: xah lee , 1406@debbugs.gnu.org Resent-From: xah lee Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 22 Nov 2008 13:10:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.1227358853381 (code B ref -1); Sat, 22 Nov 2008 13:10:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.8 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Nov 2008 13:00:53 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMD0oYR000374 for ; Sat, 22 Nov 2008 05:00:51 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3s6U-0004zO-0m for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:00:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3s6S-0004z3-Q3 for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:00:49 -0500 Received: from [199.232.76.173] (port=40994 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3s6S-0004yy-AT for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:00:48 -0500 Received: from mout.perfora.net ([74.208.4.195]:62739) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3s6R-00052N-RZ for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:00:48 -0500 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3s6I15Xv-0001OD; Sat, 22 Nov 2008 08:00:44 -0500 In-Reply-To: <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> <20081122123644.GA3330@muc.de> <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> Cc: Alan Mackenzie , 1406@debbugs.gnu.org, bug-gnu-emacs@gnu.org Content-Transfer-Encoding: quoted-printable From: xah lee Date: Sat, 22 Nov 2008 05:01:10 -0800 To: xah lee X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX19GY3MWey0JJc6M8S8VLrpdDUEmlTx0auDY8Y3 UP5g3HsnR+uRgTcwCA1gUKNDxQAsV+fatHDAEPl7mvlVLW678p tE5uhKnzoHDNZVPnQMIKg== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) X-CrossAssassin-Score: 2 Sorry never mind. i was able to duplicate your error. Some of my testing in previous =20 post went wrong because i was in text-mode. though, isn't this something easy to fix? I mean, it surely is easy =20 to determine if cursor is in inside double quotes, therefore it can =20 simply move out the quote then do backward-up-list? In any case, thanks. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 22, 2008, at 4:53 AM, xah lee wrote: hi Alan, > (defun foo (arg) > "foo does nothing." > (interactive "P")) > > Put point inside "P", and do C-M-u `backward-up-list'. You get the > error. i couldn't duplicate this. It seems to work for me. am using GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) =20 of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp i tried aquamacs. I can duplicate it with -Q, but not with -q. Now i try carbon emacs again with -q, and i _can_ duplicate it. ... umm... not sure what is the problem now... since i'm pretty sure =20 i don't have any customization for emacs-lisp-mode ... am kinda tired now. Maybe i'll do some more testing to see what i =20 find out. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 22, 2008, at 4:36 AM, Alan Mackenzie wrote: Hi, Xah! On Fri, Nov 21, 2008 at 03:26:03PM -0800, xah lee wrote: > Hi Alan, > it works if you switch to text mode though. > It doesn't work while in emacs-lisp-mode and fundamental mode. > In any case, normally it works when inside string too. Just not in > this particular case. OK, I think half of the problem here is your prolixity, the other half is my prolixity. :-) Try instead the following example: (defun foo (arg) "foo does nothing." (interactive "P")) Put point inside "P", and do C-M-u `backward-up-list'. You get the error. Now modify the above function by inserting an open paren into the doc string, (defun foo (arg) "foo does nothing. (" (interactive "P")) , and do the same again. It finds that paren. Why? Because backward-up-list assumes its starting point is NOT in a string. It jumps backwards over (what it thinks is) the string "\n(interactive " , and then finds the ?\(. This is exactly what is happening in your somewhat larger example. In text mode, presumably the syntax table doesn't define ?\" as a string quote. In fundamental mode, presumably it does. "(syntax-after (point))" is your friend here. > Xah --=20 Alan Mackenzie (Nuremberg, Germany). =E2=98=84 =E2=98=84 From unknown Sat Aug 09 05:05:43 2025 X-Loop: don@donarmstrong.com Subject: bug#1406: backward-up-list reports scan error incorrectly? Reply-To: Alan Mackenzie , 1406@debbugs.gnu.org Resent-From: Alan Mackenzie Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 22 Nov 2008 14:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122736193213419 (code B ref -1); Sat, 22 Nov 2008 14:00:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.2 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Nov 2008 13:52:12 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMDq9Td013413 for ; Sat, 22 Nov 2008 05:52:10 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3su8-00068R-Kz for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:52:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3su4-00066a-1d for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:52:05 -0500 Received: from [199.232.76.173] (port=38944 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3su3-00066P-Pk for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:52:03 -0500 Received: from colin.muc.de ([193.149.48.1]:2906 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3su3-0000ZE-9S for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 08:52:03 -0500 Received: (qmail 13298 invoked by uid 3782); 22 Nov 2008 13:52:00 -0000 Received: from acm.muc.de (pD9E532CC.dip.t-dialin.net [217.229.50.204]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 22 Nov 2008 14:51:53 +0100 Received: (qmail 5459 invoked by uid 1000); 22 Nov 2008 14:04:46 -0000 Date: Sat, 22 Nov 2008 14:04:46 +0000 To: xah lee Cc: 1406@debbugs.gnu.org, bug-gnu-emacs@gnu.org Message-ID: <20081122140446.GC3330@muc.de> References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> <20081122123644.GA3330@muc.de> <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 Hi, Xah! On Sat, Nov 22, 2008 at 05:01:10AM -0800, xah lee wrote: > i was able to duplicate your error. Some of my testing in previous > post went wrong because i was in text-mode. > though, isn't this something easy to fix? No, because it isn't a bug. It's the way the function is meant to work. If there is a bug, it's that the doc-string (and maybe the elisp manual, I haven't looked) is vague and incomplete. It seems that you really want a slightly different function. > I mean, it surely is easy to determine if cursor is in inside double > quotes, therefore it can simply move out the quote then do > backward-up-list? Well, it's easy, but very slow. You first have to define what "inside" and "outside" mean. For example, you might scan from BOB, and point is inside a string if there've been an odd number of string-quotes up to now (taking comments, etc. into account). Emacs Lisp Mode defines "inside a string" as an odd number of string-quotes since the last "(" in column-0. Try going into a large Elisp file and deleting one of the "s. It throws the fontification out for the rest of the function, but then "recovers" for the rest of the file. > In any case, thanks. You're welcome! > Xah > ??? http://xahlee.org/ -- Alan Mackenzie (Nuremberg, Germany). > On Nov 22, 2008, at 4:53 AM, xah lee wrote: > hi Alan, > >(defun foo (arg) > > "foo does nothing." > > (interactive "P")) > >Put point inside "P", and do C-M-u `backward-up-list'. You get the > >error. > (defun foo (arg) > "foo does nothing. (" > (interactive "P")) > , and do the same again. It finds that paren. Why? Because > backward-up-list assumes its starting point is NOT in a string. It > jumps backwards over (what it thinks is) the string > "\n(interactive " > , and then finds the ?\(. > This is exactly what is happening in your somewhat larger example. > In text mode, presumably the syntax table doesn't define ?\" as a string > quote. In fundamental mode, presumably it does. "(syntax-after > (point))" is your friend here. From unknown Sat Aug 09 05:05:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: xah lee Subject: bug#1406: closed (Re: bug#1406: backward-up-list reports scan error incorrectly?) Message-ID: References: X-Gnu-PR-Message: they-closed 1406 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: wontfix notabug Reply-To: 1406@debbugs.gnu.org Date: Sat, 09 Jul 2011 18:05:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1310234702-28575-1" This is a multi-part message in MIME format... ------------=_1310234702-28575-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #1406: backward-up-list reports scan error incorrectly? which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 1406@debbugs.gnu.org. --=20 1406: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1406 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1310234702-28575-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 1406-done) by debbugs.gnu.org; 9 Jul 2011 18:04:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfbt3-0007Pw-3w for submit@debbugs.gnu.org; Sat, 09 Jul 2011 14:04:17 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfbt1-0007Pi-EA for 1406-done@debbugs.gnu.org; Sat, 09 Jul 2011 14:04:15 -0400 Received: from localhost ([127.0.0.1]:47183) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qfbsv-00047m-SK; Sat, 09 Jul 2011 14:04:10 -0400 From: Glenn Morris To: 1406-done@debbugs.gnu.org Subject: Re: bug#1406: backward-up-list reports scan error incorrectly? References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> <20081122123644.GA3330@muc.de> <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> <20081122140446.GC3330@muc.de> X-Spook: M-14 Bellcore Audiotel target class struggle Attorney X-Ran: UXcQugQF0`w6E%-&"e(/~Y3r=UtYZ$]IfDFlJuG!>yAM3bZP;1H(EPgP(;}D:#57H2Fc8W X-Hue: white X-Attribution: GM Date: Sat, 09 Jul 2011 14:04:09 -0400 In-Reply-To: <20081122140446.GC3330@muc.de> (Alan Mackenzie's message of "Sat, 22 Nov 2008 14:04:46 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 1406-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) I don't see a need to keep open this particular report. The doc of backward-up-list says: "This command assumes point is not in a string or comment." ------------=_1310234702-28575-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From xah@xahlee.org Fri Nov 21 13:24:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.2 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Nov 2008 21:24:26 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALLOM54011832 for ; Fri, 21 Nov 2008 13:24:23 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3dUE-0008Jr-3z for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3dUD-0008Jc-EF for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from [199.232.76.173] (port=45623 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3dUD-0008JZ-9B for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from mout.perfora.net ([74.208.4.195]:57631) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3dUC-0004pZ-Pc for bug-gnu-emacs@gnu.org; Fri, 21 Nov 2008 16:24:21 -0500 Received: from [192.168.1.5] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1L3dUB0XsF-0001Ng; Fri, 21 Nov 2008 16:24:20 -0500 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: quoted-printable Message-Id: Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: xah lee Subject: backward-up-list reports scan error incorrectly? Date: Fri, 21 Nov 2008 13:24:30 -0800 X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX1/w83bqmdYxLJzeG831v02NgAt19l8Yg7QYFhy ikTctdMkiNtrgD29kbJ2LzxxSV7FGwYBRISQRw3ypuVl2XqV1c 2oH7Gmfq1YnzUyatVxCQw== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) This appears to be a bug of backward-up-list. Summary: when i do backward-up-list in a particular lisp file, when =20 the cursor is inside a double quote, it tell me Unbalanced =20 parentheses, but there does not seems to be any unbalanced paren. The =20= file byte-compiles fine. steps to reproduce: Save the following function to a file. (defun replace-keybinding-notation (p1 p2) "Do a bunch of find/replace on current text selection." (interactive "r") (let (mystr (case-fold-search nil) (case-replace nil)) (setq mystr (buffer-substring p1 p2)) (setq mystr (with-temp-buffer (insert mystr) ;; C- (goto-char (point-min)) (while (search-forward-regexp "C-" nil t) (replace-match "Ctlr+" t) ) ;; M- (goto-char (point-min)) (while (search-forward-regexp "M-" nil t) (replace-match "Alt+" t) ) ;; Ctrl+Alt+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+Alt\\+\\([[:graph:]]\=20 \)" nil t) (replace-match "Ctrl+Alt+\=20= \1" t) ) ;; Cmd+Shift+t (goto-char (point-min)) (while (search-forward-regexp "Cmd\\+Shift\\+\\([[:graph:]]\=20= \)" nil t) (replace-match "Cmd+Shift+\=20= \1" t) ) ;; Alt+Shift+t (goto-char (point-min)) (while (search-forward-regexp "Alt\\+Shift\\+\\([[:graph:]]\=20= \)" nil t) (replace-match "Alt+Shift+\=20= \1" t) ) ;; Ctrl+t Ctrl+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\) Ctrl=20= \\+\\([[:graph:]]\\)" nil t) (replace-match "Ctrl+\\1 Ctrl+\\2" t) ) ;; Ctrl+t (goto-char (point-min)) (while (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\)" =20 nil t) (replace-match "Ctrl+\\1" t) ) ;; Alt+t (goto-char (point-min)) (while (search-forward-regexp "Alt\\+\\([[:graph:]]\\)" nil t) (replace-match "Alt+\\1" t) ) ;; Meta+t (goto-char (point-min)) (while (search-forward-regexp "Meta\\+\\([[:graph:]]\\)" =20 nil t) (replace-match "Meta+\\1" t) ) ;; Cmd+t (goto-char (point-min)) (while (search-forward-regexp "Cmd\\+\\([[:graph:]]\\)" nil t) (replace-match "Cmd+\\1" t) ) (buffer-string) ) ) (delete-region p1 p2) (insert mystr) ) ) =E2=80=A2 start emacs by /Applications/Emacs.app/Contents/MacOS/Emacs -q =E2=80=A2 open the file. =E2=80=A2 interactive search for =E2=80=9CM-=E2=80=9D, do it twice so = that your cursor =20 is in between the double quote on the line: (search-forward-regexp =20 "M-" nil t). Press return so that your cursor is just before the =20 closing quote. =E2=80=A2 press Ctrl+Alt+=E2=86=91 (invoke backward-up-list). =E2=80=A2 emacs says: =E2=80=9Cup-list: Scan error: "Unbalanced = parentheses", 582, =20 1=E2=80=9D --------------------------------- In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp Windowing system distributor `Apple Inc.', version 10.4.11 configured using `configure '--prefix=3D/Applications/Emacs.app/=20 Contents/Resources' '--with-carbon' '--without-x' '--libexecdir=3D/=20 Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' 'CFLAGS=3D-Os -arch =20 i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DUSE_ATSUI -=20= DUSE_MAC_TSM'' Xah =E2=88=91 http://xahlee.org/ =E2=98=84= ------------=_1310234702-28575-1--