[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 <jester@panix.com> 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))))
or
(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 ;-)
Stefan
- font-lock-add-keywords frustrations, Jesse Sheidlower, 2003/05/17
- Re: font-lock-add-keywords frustrations,
Stefan Monnier <=
- Re: font-lock-add-keywords frustrations, Glenn Morris, 2003/05/18
- Re: font-lock-add-keywords frustrations, Jesse Sheidlower, 2003/05/18
- Re: font-lock-add-keywords frustrations, Stefan Monnier, 2003/05/18
- Re: font-lock-add-keywords frustrations, Martin Stemplinger, 2003/05/22
- Re: font-lock-add-keywords frustrations, Stefan Monnier, 2003/05/22
- Re: font-lock-add-keywords frustrations, John L Fjellstad, 2003/05/30
- Re: font-lock-add-keywords frustrations, Stefan Monnier, 2003/05/30