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 #45 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: xah lee <xah <at> xahlee.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 1406 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Re: bug#1406: backward-up-list reports scan error incorrectly?
Date: Sat, 22 Nov 2008 04:53:57 -0800
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)  
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  
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  
find out.

  Xah
∑ http://xahlee.org/

☄

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

-- 
Alan Mackenzie (Nuremberg, Germany).

☄







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.