[Top][All Lists]

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

Re: font-lock-add-keywords frustrations

From: Stefan Monnier
Subject: Re: font-lock-add-keywords frustrations
Date: 18 May 2003 00:17:26 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Jesse" == Jesse Sheidlower <address@hidden> writes:
> (font-lock-add-keywords 'psgml-mode
>   '(("slam" . test-face)))

font-lock expects this to be an elisp expression that will
return the face to use, but since `test-face' is not a bound
variable, it fails.  Try

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


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

I'd also recommend

  (add-hook 'psgml-mode-hook
     (lambda ()
       (font-lock-add-keywords nil '(("slam" (0 'test-face))))))

because the implementation of `font-lock-add-keywords' in the case
where the mode is not nil is pretty ugly ;-)


reply via email to

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