[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Best way to detect font-lock mode is on?
From: |
Stefan Monnier |
Subject: |
Re: Best way to detect font-lock mode is on? |
Date: |
Mon, 10 Jan 2011 12:39:01 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
>> syntax-ppss is supposed to automatically flush the (relevant part of)
>> the cache after any buffer modification. The only exceptions are when
>> the buffer is modified in a context where inhibit-modification-hooks is
>> set (e.g. font-lock-syntactic-keywords).
> hmm, that is interesting. I was getting a problem where characters were
> being incorrectly classified as comments when I ran syntax-ppss if I
> didn't also run syntax-ppss-flush-cache before calling syntax-ppss, but
> the characters were not being fontified as comments. If font-lock is
> using the same mechanism, I would have expected more consistency
Indeed.
> - must be something else going on.
My point exactly. If you can come up with a recipe that reproduces it,
we can probably help track down the origin of the problem.
> Ah, must have missed that - didn't realise there was a local variable
> called font-lock-mode. Much better solution. thanks.
(Almost) all minor modes have both a function and a variable of the same
name, where the variable stores the state (on/off) of the mode.
Check the Minor mode section in the Elisp manual.
Stefan
Re: Best way to detect font-lock mode is on?, Ilya Zakharevich, 2011/01/11