[Top][All Lists]

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

Re: feature request: text property to prevent font-locking

From: Alan Mackenzie
Subject: Re: feature request: text property to prevent font-locking
Date: Sat, 30 Aug 2014 09:27:01 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi, Drew.

On Thu, Aug 28, 2014 at 02:18:28PM -0700, Drew Adams wrote:
> Excuse me if I'm missing something that is already available.
> And in that case, please let me know what it is, so I can use it.

> I want to apply some ad-hoc highlighting with text property `face'
> in a font-locked buffer (whether font-locking occurs before or after
> I apply `face' for this highlighting).

> I do not want font-lock to override this highlighting.  I do not want
> to use `font-lock-keywords' (e.g. with KEEP) in order to create this
> highlighting.  I just want to prevent font-lock from overriding it.

> I want to apply some other text property to the highlighted text, to
> tell font-lock not to fiddle with it ("hands off this text").

> 1. Does this possibility already exist in Emacs?  I looked but didn't
>    find anything.

> 2. If not, can we please add it?

[ .... ]

For this particular application of fontifying, you might be able to use
overlays, which take priority over text properties (see page "Overlay
Properties" in the Elisp manual).  You might have to define a lot of
attributes for the overlay face to prevent attributes from font-locking
"showing through".

That feels like a bit of a kludge, though.  The facility you've sketched
out (and implemented) might well be a useful one.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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