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: 6 Mar 2013 20:27:01 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

Stefan Monnier wrote:
> Hmm... I can't find your previous email, but I now notice there are
> 2 differences in the above lines.  I focused on the `how' argument to
> font-lock-add-keywords, but the other important one is that
>
>    (font-lock-add-keywords
>     nil `((,(regexp-quote "{++") . '(face cm-addition-face read-only t))) t)
>
> should be
>
>    (font-lock-add-keywords
>     nil `((,(regexp-quote "{++") (0 '(face cm-addition-face read-only t)))) t)
>
> because the (REGEXP . FACE) form only works if FACE is a non-list sexp.

Or what the manual calls a SUBEXP-HIGHLIGHTER, i.e., a list of the form:

,----
| (0 '(face cm-addition-face read-only t)))) t)
`----

However, what confused me was that the manual says:

(info "(elisp) Search-based Fontification")
,----
| `(MATCHER . FACESPEC)'
|      [...]
|      However, FACESPEC can also evaluate to a list of this form:
| 
|           (face FACE PROP1 VAL1 PROP2 VAL2...)
| 
|      to specify the face FACE and various additional text properties to
|      put on the text that matches.
`----

which to me means that it should be possible to have:

(MATCHER . (face FACE PROP1 VAL1))

(save for the quote, but I originally tried both with and without).

which, as you point out, isn't possible. So either I'm reading the
manual wrong, or I should report a bug in the manual. :-)


-- 
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]