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
boundary?
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
nesting.
0