bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23019: parse-partial-sexp doesn't output the full state needed for i


From: Stefan Monnier
Subject: bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance.
Date: Thu, 17 Mar 2016 08:58:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> Proposed solution: Add an extra element to the parser state, recording the
> syntax of the last character passed over before the end of the parse.
> This would be used by parse-partial-sexp to initialise its parse.

Another option is to record "the start of current element" (in case we
were in the middle of an element).  This could potentially reuse (nth
5 ppss) by generalizing it, or it could use a new entry.

The choice probably doesn't matter much and will probably be more
a question of "what's easier to implement".

> Also: the existing element 9 (the list of currently open parens) and the
> new element should be explicitly documented in the Elisp manual, together
> with a statement that there may be further elements in the parse state
> used internally by parse-partial-sexp (for future expansion).

Indeed.

Andreas Röhler added:
> a comment start might be composed not just by two characters, but by three
> or more. What then?

Andreas, I suggest that you go back and take a closer look at
parse-partial-sexp, syntax-ppss, and syntax-tables in general because
lately you've made several comments like the one here which show you're
just not familiar with the topic at all.  Syntax tables do not support
comment markers longer than 2 characters (currently).  Emacs supports
those via the `syntax-table' text-property only (which typically marks
the first char of each "long comment starter" as being "the comment
starter").


        Stefan





reply via email to

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