Subject: bug#1406: closed (Re: bug#1406: backward-up-list reports scan error incorrectly?)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 09 Jul 2011 18:05:02 +0000

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 [email-masked].

-- 
1406: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1406
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#1406: backward-up-list reports scan error incorrectly?
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Sat, 09 Jul 2011 14:04:09 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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."

>From [email-masked] Fri Nov 21 13:24:26 2008
To: [email-masked]
From: xah lee <[email-masked]>
Subject: backward-up-list reports scan error incorrectly?
Date: Fri, 21 Nov 2008 13:24:30 -0800

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 "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Ctrl</span>+<span class=3D\"key\">Alt</span>+<span class=3D\"key\">\=20=

\1</span></span>" t) )

             ;; Cmd+Shift+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Cmd\\+Shift\\+\\([[:graph:]]\=20=

\)" nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Cmd</span>+<span class=3D\"key\">Shift</span>+<span class=3D\"key\">\=20=

\1</span></span>" t) )

             ;; Alt+Shift+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Alt\\+Shift\\+\\([[:graph:]]\=20=

\)" nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Alt</span>+<span class=3D\"key\">Shift</span>+<span class=3D\"key\">\=20=

\1</span></span>" t) )

             ;; Ctrl+t Ctrl+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\) Ctrl=20=

\\+\\([[:graph:]]\\)" nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Ctrl</span>+<span class=3D\"key\">\\1</span> <span class=3D\"key=20
\">Ctrl</span>+<span class=3D\"key\">\\2</span></span>" t) )

             ;; Ctrl+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Ctrl\\+\\([[:graph:]]\\)" =20
nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Ctrl</span>+<span class=3D\"key\">\\1</span></span>" t) )

             ;; Alt+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Alt\\+\\([[:graph:]]\\)" nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Alt</span>+<span class=3D\"key\">\\1</span></span>" t) )

             ;; Meta+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Meta\\+\\([[:graph:]]\\)" =20
nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Meta</span>+<span class=3D\"key\">\\1</span></span>" t) )

             ;; Cmd+t
             (goto-char (point-min))
             (while
                 (search-forward-regexp "Cmd\\+\\([[:graph:]]\\)" nil t)
               (replace-match "<span class=3D\"kbd\"><span class=3D\"key=20=

\">Cmd</span>+<span class=3D\"key\">\\1</span></span>" 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=