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: Stefan Monnier
Subject: Re: how to prevent font-lock from messing with a portion of text?
Date: Fri, 23 Mar 2007 12:07:53 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

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

The `font-lock-face' property was designed specifically for this kind of case.

> 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).

Again, there's no such general facility, so give us more info.

> I thought that's what property `fontified' (= t) would do, but that seems
> not to be the case.

`fontified' is a jit-lock thing, so don't expect to be able to use it to
solve font-lock problems.

> The Elisp manual says this about `fontified':

>      This property says whether the character has a face assigned to it
>      by font locking.  The display engine tests it to decide whether a
>      buffer portion needs refontifying before display.  *Note Auto
>      Faces::.  It takes one of three values:

>     `nil'
>           Font locking is disabled, or the character's `face' property,
>           if any, is invalid.

Huh?  I don't agree with this part of the manual.  `nil' means that the
fontification is not uptodate (so it will be refontified next time the block
is made visible, for example).

So I think the term "invalid" is a bit strong here.  Also it's not "font
locking is disabled" but "jit-lock is disabled".


        Stefan




reply via email to

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