all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11321: 24.0.95; forward-sexp fails on string
@ 2012-04-24  4:12 Leo
  2012-04-24 12:45 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Leo @ 2012-04-24  4:12 UTC (permalink / raw
  To: 11321

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

 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

[-- Attachment #2: app.py.bz2 --]
[-- Type: application/octet-stream, Size: 15443 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#11321: 24.0.95; forward-sexp fails on string
  2012-04-24  4:12 bug#11321: 24.0.95; forward-sexp fails on string Leo
@ 2012-04-24 12:45 ` Stefan Monnier
  2016-11-05 19:47   ` npostavs
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2012-04-24 12:45 UTC (permalink / raw
  To: Leo; +Cc: 11321

> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#11321: 24.0.95; forward-sexp fails on string
  2012-04-24 12:45 ` Stefan Monnier
@ 2016-11-05 19:47   ` npostavs
  0 siblings, 0 replies; 3+ messages in thread
From: npostavs @ 2016-11-05 19:47 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 11321, Leo

found 11321 24.2
tags 11321 fixed
close 11321 24.3
quit

Stefan Monnier <monnier@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-05 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24  4:12 bug#11321: 24.0.95; forward-sexp fails on string Leo
2012-04-24 12:45 ` Stefan Monnier
2016-11-05 19:47   ` npostavs

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.