From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: set font for TODO Date: Thu, 13 Jun 2013 10:44:24 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371138740 30807 80.91.229.3 (13 Jun 2013 15:52:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Jun 2013 15:52:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 13 17:52:21 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Un9oy-0000si-OH for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Jun 2013 17:52:20 +0200 Original-Received: from localhost ([::1]:53024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un9oy-0003OC-E7 for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Jun 2013 11:52:20 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Injection-Info: mx05.eternal-september.org; posting-host="159116255ce7d0b522977afcd6e918a8"; logging-data="20656"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+17d3hjKG9KG3Bnx/kSDBz" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:Rm+7SxS4+jt4pXu6fZcIO6jkvJw= sha1:OG+fPSdNpmRxfFvU5et3iHJfvuI= Original-Xref: usenet.stanford.edu gnu.emacs.help:199247 X-Mailman-Approved-At: Thu, 13 Jun 2013 11:49:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91518 Archived-At: > (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