help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: font lock woes


From: Joost Kremers
Subject: Re: font lock woes
Date: 5 Mar 2013 18:07:38 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

Stefan Monnier wrote:
>> Yes, I have, and the matchers are there, but the relevant strings do not
>> get fontified: cm-addition-face (which is just a foreground color) isn't
>> applied and matching text is not read-only.
>
> Could it be that the relevant strings already have some other face?

No, the relevant strings don't have another face. Before I tried adding
the read-only property, I just had:

,----
| (font-lock-add-keywords nil `((,(regexp-quote "{++") . cm-addition-face)) t)
`----

and that worked fine. Changing that line to 

,----
| (font-lock-add-keywords nil `((,(regexp-quote "{++") . '(face 
cm-addition-face read-only t))) t)
`----

made fontification of the relevant strings stop working. After changing it to:

,----
| (font-lock-add-keywords nil `((,(regexp-quote "{++") 0 '(face 
cm-addition-face read-only t))
`----

fontification worked again.

>> visible part of the buffer, the call to font-lock-fontify-buffer above
>> removes the font-lock-face property but not the read-only property.
>
> No, the call itself does not, it only schedules the buffer for
> refontification, i.e. the font-lock-face is only removed (in the visible
> part) during the next redisplay, at which point you've already removed
> `read-only' from font-lock-extra-managed-props.

Ah, ok, it makes sense now. Thanks for the explanation.


-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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