help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

font-lock-add-keywords frustrations


From: Jesse Sheidlower
Subject: font-lock-add-keywords frustrations
Date: 17 May 2003 23:16:37 -0400

I've been trying to learn how to use some font features, and 
have managed to get stuck at the very start of the project I
was trying to do. I cannot seem to get font-lock-add-keywords
working the way I expect.

After trying some slightly more elaborate setups with keeping
the keywords in a separate variable and so forth, I reduced
the relevant part of my .emacs to a short test case:

(defface test-face
'((((class color) (background dark))
   (:background "red" :foreground "black" bold t))
  (((class color) (background light))
   (:background "red" :foreground "black" bold t))
  (t (:background "green")))
"Test face."
)

(font-lock-add-keywords 'psgml-mode
  '(("slam" . test-face)))

My intention was to have all instances of "slam" in a text
viewed in psgml-mode to appear in the face test-face. It does
not work.  I have tried a number of variations (trying
different words in case "slam" was being superseded by some
other keyword; trying the same thing in cperl-mode and other
modes that support font-locking; trying built-in fonts; etc.)
and none of them have worked. test-face does show up in
list-faces-display, gaudy as intended.  I've looked through
the archives of this list, as well as the Manual, the Emacs
Wiki, and other places, and I can't see what I'm missing.

I would be grateful for any suggestions. I'm using GNU Emacs
21.2.1 on FreeBSD in an X environment.

Thank you.

Jesse Sheidlower


reply via email to

[Prev in Thread] Current Thread [Next in Thread]