From: Joost Kremers <joostkremers@yahoo.com>
To: help-gnu-emacs@gnu.org
Subject: Re: font lock woes
Date: 6 Mar 2013 20:27:01 GMT [thread overview]
Message-ID: <slrnkjf9kl.d23.joostkremers@j.kremers4.news.arnhem.chello.nl> (raw)
In-Reply-To: mailman.21515.1362537854.855.help-gnu-emacs@gnu.org
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)
next prev parent reply other threads:[~2013-03-06 20:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 23:22 font lock woes Joost Kremers
2013-03-04 16:03 ` Stefan Monnier
[not found] ` <mailman.21363.1362413049.855.help-gnu-emacs@gnu.org>
2013-03-04 18:54 ` Joost Kremers
2013-03-04 22:32 ` Stefan Monnier
[not found] ` <mailman.21401.1362436369.855.help-gnu-emacs@gnu.org>
2013-03-05 18:07 ` Joost Kremers
2013-03-06 2:43 ` Stefan Monnier
[not found] ` <mailman.21515.1362537854.855.help-gnu-emacs@gnu.org>
2013-03-06 20:27 ` Joost Kremers [this message]
2013-03-09 13:09 ` Stefan Monnier
[not found] ` <mailman.21754.1362834587.855.help-gnu-emacs@gnu.org>
2013-03-11 19:41 ` Joost Kremers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnkjf9kl.d23.joostkremers@j.kremers4.news.arnhem.chello.nl \
--to=joostkremers@yahoo.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.