[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cannot activate font-lock-mode
From: |
Chong Yidong |
Subject: |
Re: cannot activate font-lock-mode |
Date: |
Thu, 31 May 2007 11:00:22 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> Should this fix be installed in Emacs 22.1?
> Or is it safer for us to leave that bug unfixed?
I suggest not patching Emacs 22.1 at this time.
First, this only affects setting font-lock-keywords in local
variables, which is an advanced user activity that we generally
discourage for security reasons; that is why font-lock-keywords is
marked risky.
Second, allowing file local variables to change font-lock-keywords
seems to violate an implicit assumption made in font-lock that
font-lock-keywords is managed by font-lock, and set by either
major/minor modes or by higher-level variables such as
font-lock-defaults. That assumption is why font-lock-set-defaults
inadvertently wipes out the font-lock-keywords set by file-local
variables. This may be a simple oversight made when revamping
font-lock-keywords earlier in the development cycle, but this just
emphasizes the fact that this behavior is delicate. So I think
changing it is risky at this stage.
Third, for those advanced users that want this feature, there are many
ways to work around this problem: calling font-lock-add-keyword using
an eval in the file variables section, using hi-lock-mode, etc.