[Top][All Lists]

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

Re: Syntax tables for multiple modes [was: bug#22983: syntax-ppss return

From: Andreas Röhler
Subject: Re: Syntax tables for multiple modes [was: bug#22983: syntax-ppss returns wrong result.]
Date: Mon, 14 Mar 2016 18:34:45 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.5.0

On 14.03.2016 16:16, Alan Mackenzie wrote:
Hello, Dmitry.

On Sat, Mar 12, 2016 at 12:38:49AM +0200, Dmitry Gutov wrote:
On 03/12/2016 12:15 AM, Alan Mackenzie wrote:
Except the multiple-major-mode case, which we'd ideally try to
accommodate, too.
How does this code handle the changeover of syntax tables at a mode
The "inner" regions start with an "empty", top-level state. This is
actually fine, because these are usually small enough not to benefit
from the syntax-ppss cache too much (and syntax-ppss-last still helps).
The parts of the outer region following a subregion with different
syntax table... rely on a few hacks, and a manual application of a
`syntax-table' property when necessary. We need a better solution there,
but it's probably out of scope for this discussion.
How about an extension to the parse-partial-sexp (etc.) code?  For
example, a feature I would call an "island", where a character could be
marked with the "island start" syntax-table property, and another
character lower down could be marked with the "island end" character.
parse-partial-sexp, on encountering an island start syntax would somehow
stack the current parse state and start a new one with a different syntax
table.  The parse state, instead of consisting of the 10 elements
currently, would in general have 10n elements, where n is the depth of

AFAIU narrowing would provide that already WRT parse-partial-sexp, maybe combined with some markup like folding-mode. Remains to hand over these sheets to font-lock.

reply via email to

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