unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: xah lee <xah@xahlee.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 1406@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org
Subject: bug#1406: backward-up-list reports scan error incorrectly?
Date: Fri, 21 Nov 2008 15:26:03 -0800	[thread overview]
Message-ID: <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> (raw)
In-Reply-To: <20081121231944.GB2089@muc.de>

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.

   Xah
∑ http://xahlee.org/

☄

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

☄








  reply	other threads:[~2008-11-21 23:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 21:24 bug#1406: backward-up-list reports scan error incorrectly? xah lee
     [not found] ` <handler.1406.B.122730266611840.ack@emacsbugs.donarmstrong.com>
2008-11-21 21:39   ` bug#1406: Acknowledgement (backward-up-list reports scan error incorrectly?) xah lee
2008-11-21 23:19 ` bug#1406: backward-up-list reports scan error incorrectly? Alan Mackenzie
2008-11-21 23:26   ` xah lee [this message]
2008-11-22 12:36     ` Alan Mackenzie
2008-11-22 12:53       ` xah lee
2008-11-22 13:01         ` xah lee
2008-11-22 14:04           ` Alan Mackenzie
2011-07-09 18:04             ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org \
    --to=xah@xahlee.org \
    --cc=1406@emacsbugs.donarmstrong.com \
    --cc=acm@muc.de \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).