emacs-devel
[Top][All Lists]
Advanced

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

Re: (add-hook 'font-lock-mode-hook ...) keeps adding to font-lock-keywor


From: Stefan Monnier
Subject: Re: (add-hook 'font-lock-mode-hook ...) keeps adding to font-lock-keywords
Date: Fri, 02 Sep 2005 10:34:30 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> (defun show-tabs () "Show tabs with a slightly changed background"
>    (setq font-lock-keywords
>       (append font-lock-keywords '(("[\t]+"  (0 'tab-face t))))))
> (add-hook 'font-lock-mode-hook 'show-tabs)

font-lock-mode-hook is called both when turning the mode ON and when turning
the mode OFF.

font-lock-keywords should not be modified as you do.  Instead you should use
font-lock-add-keywords, which knows about font-lock-compile-keywords.


        Stefan




reply via email to

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