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

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

Re: Changes to syntax at fontification


From: Stefan Monnier
Subject: Re: Changes to syntax at fontification
Date: Wed, 08 Dec 2010 15:28:20 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> What benefits will I have if start using the syntax-propertize-
> function?
[...]
> If I have extended my mode-specific colorings using calls to font-lock-
> add-keywords can/should I somehow refactor these into calls to syntax-
> propertize-function?

The two are unrelated: syntax-propertize-function replaces
font-lock-syntactic-keywords whereas font-lock-add-keywords affects
font-lock-keywords.
The benefit of syntax-propertize-function is that it's independent on
font-lock, so it makes the benefits of font-lock-syntactic-keywords
available even when font-lock is disabled or hasn't touched that
corresponding part of the buffer (e.g. because you have not disabled
jit-lock and haven't displayed this part of the buffer yet).
One example is to use Emacs's indent-region in batch mode to
auto-reindent a bunch of files.


        Stefan


reply via email to

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