emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Musings: Supposed places of safety, guaranteed by parse-partial-sexp


From: Stefan Monnier
Subject: Re: Musings: Supposed places of safety, guaranteed by parse-partial-sexp are not safe.
Date: Sat, 03 Dec 2011 22:39:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

> There's a problem with parse-partial-sexp.  If one scans to the middle
> of a comment opener  /*
>                       ^
>                       |
> , parse-partial-sexp gives no indication that we might be half inside a
[...]
> No doubt there is some record of this state hidden away in (nth 9 state).

IIRC you're just a bit too optimistic: parse-partial-sexp does not
record this info anywhere.  And yes, if my recollection is right, that
means it's got a bug.

The better way to fix it is probably to change the (nth 5 ppss) value so
it holds something like "buffer position actually described by PPSS in
case the requested buffer position is in the middle of a lexeme" and
so it can be used for both backslashes and multi-char comment markers.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]