emacs-devel
[Top][All Lists]
Advanced

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

Re: Syntax ambiguities in narrowed buffers and multiple major modes: a p


From: Stefan Monnier
Subject: Re: Syntax ambiguities in narrowed buffers and multiple major modes: a proposed solution.
Date: Mon, 27 Feb 2017 18:22:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> If so, it's a complete accident.  The fragment came straight out of
> my imagination.  The situations I have in mind are more like in
> perl-mode's syntax-propertize function where we need to find the
> matching braces in regexp operations (where the matching rules are
> slightly different from the ones in normal code) or in sgml-mode where
> we jump from < to > and vice-versa using a specialized syntax-table, or
> in sm-c-mode where I parse the C code within a CPP directive (itself
> treated from the outside as a kind of comment).

FWIW, I looked at the sgml-mode parser and it looks pretty much like
that (a backward-sexp within a with-syntax-table within a loop), indeed,
except for one big difference: there's no narrowing (AFAICT the special
syntax table used to jump from > to the opening < just doesn't have
comments, luckily), and indeed it wouldn't be very clear where to start
the narrowing anyway (after all, the start is what we're looking for in
the first place).


        Stefan




reply via email to

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