GNU bug report logs - #11321
24.0.95; forward-sexp fails on string

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Tue, 24 Apr 2012 04:18:02 UTC

Severity: normal

Tags: fixed

Found in versions 24.2, 24.0.95

Fixed in version 24.3

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11321 in the body.
You can then email your comments to 11321 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11321; Package emacs. (Tue, 24 Apr 2012 04:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 Apr 2012 04:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.95; forward-sexp fails on string
Date: Tue, 24 Apr 2012 12:12:07 +0800
[Message part 1 (text/plain, inline)]
 1. Emacs -Q
 2. decompress and open the attached file
 3. M-: (goto-char 2345) which should move point to the beginning of a
    triple quote string in python.
 4. C-M-f

,----
| Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 2345 70003)
|   scan-sexps(2345 1)
|   forward-sexp(1)
|   call-interactively(forward-sexp nil nil)
`----

 5. C-f C-f, so that you are on the last "
 6. C-M-f
 7. M-: (goto-char 2345)
 8. C-M-f

This time it succeeds.

Could someone explain what is going on? Is this a bug? Thanks.

Leo
[app.py.bz2 (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11321; Package emacs. (Tue, 24 Apr 2012 12:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 11321 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11321 <at> debbugs.gnu.org
Subject: Re: bug#11321: 24.0.95; forward-sexp fails on string
Date: Tue, 24 Apr 2012 08:45:29 -0400
> Could someone explain what is going on? Is this a bug? Thanks.

Here's my explanation: when you do the first C-M-f, syntax-propertize
has not yet been applied to the end of the triple-quoted-string, so its
end is not properly marked and forward-sexp doesn't find it.  The C-M-f
at point 6 moves point such that the end of the string does get
displayed, thus forcing application of syntax-propertize to the
problematic area, so the C-M-f at point 8 finds that the string has
already been processed in its entirety (or at least both the beginning
and the end have been processed, which are the only parts that matter),
leading to C-M-f working right this time.

IOW, the problem is that syntax-propertize is currently applied "just in
time" for font-lock, but not "just in time" for forward-sexp.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11321; Package emacs. (Sat, 05 Nov 2016 19:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 11321 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11321 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>
Subject: Re: bug#11321: 24.0.95; forward-sexp fails on string
Date: Sat, 05 Nov 2016 15:47:09 -0400
found 11321 24.2
tags 11321 fixed
close 11321 24.3
quit

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Could someone explain what is going on? Is this a bug? Thanks.
>
> Here's my explanation: when you do the first C-M-f, syntax-propertize
> has not yet been applied to the end of the triple-quoted-string, so its
> end is not properly marked and forward-sexp doesn't find it.  The C-M-f
> at point 6 moves point such that the end of the string does get
> displayed, thus forcing application of syntax-propertize to the
> problematic area, so the C-M-f at point 8 finds that the string has
> already been processed in its entirety (or at least both the beginning
> and the end have been processed, which are the only parts that matter),
> leading to C-M-f working right this time.
>
> IOW, the problem is that syntax-propertize is currently applied "just in
> time" for font-lock, but not "just in time" for forward-sexp.

I can reproduce in 24.2 and below, but seems to be fixed in 24.3 and above.




bug Marked as found in versions 24.2. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 05 Nov 2016 19:47:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 05 Nov 2016 19:47:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.3, send any further explanations to 11321 <at> debbugs.gnu.org and Leo <sdl.web <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 05 Nov 2016 19:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 202 days ago.

Previous Next


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