unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* font-lock-add-keywords frustrations
@ 2003-05-18  3:16 Jesse Sheidlower
  2003-05-18  4:17 ` Stefan Monnier
  2003-05-18 10:14 ` Glenn Morris
  0 siblings, 2 replies; 9+ messages in thread
From: Jesse Sheidlower @ 2003-05-18  3:16 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-05-30 13:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-18  3:16 font-lock-add-keywords frustrations Jesse Sheidlower
2003-05-18  4:17 ` Stefan Monnier
2003-05-18 10:14 ` Glenn Morris
2003-05-19  1:06   ` Jesse Sheidlower
2003-05-19  2:27     ` Stefan Monnier
2003-05-22 20:29       ` Martin Stemplinger
2003-05-22 21:02         ` Stefan Monnier
2003-05-30  4:32           ` John L Fjellstad
2003-05-30 13:46             ` Stefan Monnier

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).