emacs-devel
[Top][All Lists]
Advanced

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

Re: how to prevent font-lock from messing with a portion of text?


From: Lennart Borgman (gmail)
Subject: Re: how to prevent font-lock from messing with a portion of text?
Date: Thu, 22 Mar 2007 21:09:40 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

Drew Adams wrote:
How can one prevent font-lock from changing the text properties
of a given portion of text? I tried (put-text-property start end
'fontified t), but C-x C-s just re-font-lock fontifies the text
in question.  I also tried binding `inhibit-modification-hooks'
to t, with the same result.
There are many different ways, each one with advantages and quirks,
I can't recommend any without knowing more of what you're trying to do,

Use put-text-property to add a face to some text using the `face' property.
Prevent subsequent "erasure" of that highlighting by font-lock.

I would like to be able to, say, set a particular text property on the same
text, which would cause font-lock to ignore that text (skip over it, as if
it weren't there).

I thought that's what property `fontified' (= t) would do, but that seems
not to be the case. The Elisp manual says this about `fontified':

Did you try using something like the defmacro `save-buffer-state' that you can find in font-lock.el?




reply via email to

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