From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: set font for TODO
Date: Thu, 13 Jun 2013 10:44:24 -0400 [thread overview]
Message-ID: <jwvwqpydqf8.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.925.1370265110.22516.help-gnu-emacs@gnu.org
> (defun fluca1978/fontify-fixme ()
> (font-lock-add-keywords
> nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\|XXX\\)[ \t\s\n:]*"
> 1 fluca1978-programming-fixme-face t))))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This part of a font-lock-keyword is supposed to be an expression that,
when evaluated, returns the face to use. So it will signal an error
"fluca1978-programming-fixme-face is void" because there is no
fluca1978-programming-fixme-face variable.
IOW you need to add a quote in front of it.
> The result is that nothing is emphasized. Moreover if I write, for
> instance, FIXME (without the colon) I get the following words
> un-fontified, as if the regular expression was wrong. What am I
> missing?
When this happens, check your *Messages* buffer. It will probably
contain the error message.
The best way to debug those things is:
(setq font-lock-support-mode nil)
(setq debug-on-error t)
and then try again (turning font-lock-mode off and then back on after
applying the setting). This will make font-lock happen "synchronously"
rather than via jit-lock, so it will signal errors which debug-on-error
can catch.
Stefan
prev parent reply other threads:[~2013-06-13 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 6:54 set font for TODO Luca Ferrari
2013-06-03 12:43 ` Tim Visher
2013-06-03 13:11 ` Luca Ferrari
[not found] ` <mailman.925.1370265110.22516.help-gnu-emacs@gnu.org>
2013-06-13 14:44 ` Stefan Monnier [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwqpydqf8.fsf-monnier+gnu.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).