From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jester@panix.com (Jesse Sheidlower) Newsgroups: gmane.emacs.help Subject: font-lock-add-keywords frustrations Date: 17 May 2003 23:16:37 -0400 Organization: Oxford University Press Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1053228299 2626 80.91.224.249 (18 May 2003 03:24:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 18 May 2003 03:24:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sun May 18 05:24:57 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19HEnB-0000gC-00 for ; Sun, 18 May 2003 05:24:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HEnW-0006EC-03 for gnu-help-gnu-emacs@m.gmane.org; Sat, 17 May 2003 23:25:18 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!panix!panix2.panix.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: panix2.panix.com Original-X-Trace: reader1.panix.com 1053227797 1047 166.84.1.2 (18 May 2003 03:16:37 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Sun, 18 May 2003 03:16:37 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:113350 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9844 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9844 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