From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.help Subject: Re: font-lock-add-keywords frustrations Date: Sun, 18 May 2003 11:14:53 +0100 Organization: None Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053252882 20986 80.91.224.249 (18 May 2003 10:14:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 18 May 2003 10:14:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sun May 18 12:14:40 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 19HLBg-0005SM-00 for ; Sun, 18 May 2003 12:14:40 +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 19HLCp-0008TP-02 for gnu-help-gnu-emacs@m.gmane.org; Sun, 18 May 2003 06:15:52 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!news-mue1.dfn.de!news-koe1.dfn.de!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!pegasus.csx.cam.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: xpc14.ast.cam.ac.uk X-Attribution: GM Mail-Copies-To: never User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cancel-Lock: sha1:mFnYIE3PjZZS54W/F1x4LS3pMPs= Original-Xref: shelby.stanford.edu gnu.emacs.help:113356 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:9850 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9850 Jesse Sheidlower wrote: > (defface test-face [...] > (font-lock-add-keywords 'psgml-mode > '(("slam" . test-face))) Try quoting test-face: (font-lock-add-keywords 'psgml-mode '(("slam" . 'test-face))) Though I do not have psgml-mode, that works for me in lisp-mode, etc. In the documentation of the variable `font-lock-keywords', you will find FACENAME is an expression whose *value* is the face name to use. (my emphasis). Thus, in your version, the font-lock machinery was trying to evaluate test-face as a variable. The examples given in the documentation for the function `font-lock-add-keywords' make use of the fact that `font-lock-variable-name-face' etc are also variables whose values are faces of the same name. Perhaps this is unfortunate in the context of an example. So, another way round your problem would be (setq test-face 'test-face) ie make test-face's variable definition be the face test-face.