[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to prevent font-lock (& jit-lock etc.) from refontifying?
From: |
Stefan Monnier |
Subject: |
Re: How to prevent font-lock (& jit-lock etc.) from refontifying? |
Date: |
Wed, 13 Oct 2004 21:20:05 GMT |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) |
> In Emacs 20, I only had to worry about lazy-lock doing this, and function
> lazy-lock-after-fontify-buffer was available to convince lazy-lock not to
> undo things behind my back. I could just call that function after
> highlighting, to fool lazy-lock into thinking there was no need to
> rehighlight. This function, lock-after-fontify-buffer, is still available in
> Emacs 21.
Such a hack will not prevent future re-highlighting (e.g. if you later on
make a change on the same line). If that's good enough, then just do:
(let ((inhibit-modification-hooks t))
(put-text-property start end 'face 'toto))
> Please don't reply that I should just use font-lock-keywords and let
> font-lock do the highlighting. Assume that there is a reason I want to add
> some-face as the 'face property using put-text-property. Thanks.
Without knowing the reason why you want to do it, I can't give you a good
answer.
Stefan