GNU bug report logs - #1406
backward-up-list reports scan error incorrectly?

Previous Next

Package: emacs;

Reported by: xah lee <xah <at> xahlee.org>

Date: Fri, 21 Nov 2008 21:30:03 UTC

Severity: normal

Tags: notabug, wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Glenn Morris <rgm <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#1406: closed (backward-up-list reports scan error incorrectly?)
Date: Sat, 09 Jul 2011 18:05:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 09 Jul 2011 14:04:09 -0400
with message-id <uyd3hj72li.fsf <at> fencepost.gnu.org>
and subject line Re: bug#1406: backward-up-list reports scan error incorrectly?
has caused the GNU bug report #1406,
regarding backward-up-list reports scan error incorrectly?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
1406: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1406
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: xah lee <xah <at> xahlee.org>
To: bug-gnu-emacs <at> gnu.org
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  
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.

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:]]\ 
\)" nil t)
              (replace-match "<span class=\"kbd\"><span class=\"key 
\">Ctrl</span>+<span class=\"key\">Alt</span>+<span class=\"key\">\ 
\1</span></span>" t) )

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

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

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

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

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

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

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

            (buffer-string)
            )
          )

    (delete-region p1 p2)
    (insert mystr)
    )
  )

• start emacs by /Applications/Emacs.app/Contents/MacOS/Emacs -q

• open the file.

• interactive search for “M-”, do it twice so that your cursor  
is in between the double quote on the line: (search-forward-regexp  
"M-" nil t). Press return so that your cursor is just before the  
closing quote.

• press Ctrl+Alt+↑ (invoke backward-up-list).

• emacs says: “up-list: Scan error: "Unbalanced parentheses", 582,  
1”

---------------------------------

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=/Applications/Emacs.app/ 
Contents/Resources' '--with-carbon' '--without-x' '--libexecdir=/ 
Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' 'CFLAGS=-Os -arch  
i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DUSE_ATSUI - 
DUSE_MAC_TSM''

  Xah
∑ http://xahlee.org/
[Message part 3 (message/rfc822, inline)]
From: Glenn Morris <rgm <at> gnu.org>
To: 1406-done <at> debbugs.gnu.org
Subject: Re: bug#1406: backward-up-list reports scan error incorrectly?
Date: Sat, 09 Jul 2011 14:04:09 -0400
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."




This bug report was last modified 14 years and 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.