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


Message #15 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: xah lee <xah <at> xahlee.org>, 1406 <at> debbugs.gnu.org
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#1406: backward-up-list reports scan error incorrectly?
Date: Fri, 21 Nov 2008 23:19:44 +0000
'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).





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

Previous Next


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