[Top][All Lists]

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

Re: font-lock-syntactic-keywords obsolet?

From: Stefan Monnier
Subject: Re: font-lock-syntactic-keywords obsolet?
Date: Sun, 19 Jun 2016 23:08:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> In CC Mode, all the uses of the syntax-table property are
> "local"; a buffer change in an earlier part of the buffer (aside from
> crude syntactic things like inserting unclosed comment/string
> delimiters) cannot affect the properties on the current part of the
> buffer.

AFAICT, this doesn't actually depend on how the syntax-table property is
applied.  I.e. it's not really a choice of CC-mode's author, it's just
the way the language(s) were defined, and indeed this also applies to
all other languages I can think of (and hence all major modes where we
use syntax-propertize).

And indeed, syntax-propertize doesn't take advantage of this property.
The reason is that it's hard to take advantage of it: you need to reason
hard about which are those "crude syntactic things" (i.e. the exceptions
to the general rule) and then add special code to recognize them, and
optimize those cases.

So far there has not been a performance issue which has justified
investing the effort into this kind of optimization.  I don't see
anything in the design of syntax-propertize which would make it
impossible/hard to retro-fit such an optimization, so if/when the need
arises, we'll probably be able to cook something up.


reply via email to

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