[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set font for TODO
From: |
Stefan Monnier |
Subject: |
Re: set font for TODO |
Date: |
Thu, 13 Jun 2013 10:44:24 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> (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