GNU bug report logs - #5129
23.1.50; adding font-lock-keywords for face highlight

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <Roland.Winkler <at> physik.uni-erlangen.de>

Date: Sat, 5 Dec 2009 19:20:04 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Roland Winkler <Roland.Winkler <at> physik.uni-erlangen.de>
Cc: 5129 <at> debbugs.gnu.org
Subject: bug#5129: 23.1.50; adding font-lock-keywords for face highlight
Date: Sat, 05 Dec 2009 15:32:07 -0500
"Roland Winkler" wrote:

>   (font-lock-add-keywords nil '(("foo" . font-lock-constant-face)))

works

>   (font-lock-add-keywords nil '(("foo" . highlight)))

doesn't work.

I think you are running into the old issue that faces should be quoted
in font-lock keywords, else they will be treated as variables. For
historical reasons, font-lock-constant-face (etc) as well as being a
face, is a variable whose value is that face.

Instead, try

(font-lock-add-keywords nil '(("foo" . 'highlight)))



This bug report was last modified 15 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.