emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-refresh-defaults


From: Stefan Monnier
Subject: Re: font-lock-refresh-defaults
Date: Thu, 22 Jul 2010 16:46:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> (defun Buffer-menu-fontify-and-adjust-frame ()
>   "Use for `buffer-menu-mode-hook'.  Fontify, fit and raise frame."
>   (save-window-excursion
>     (save-excursion
>       (pop-to-buffer "*Buffer List*")
>       (when (< emacs-major-version 21)
>         (make-local-variable 'font-lock-defaults))
>       (setq font-lock-defaults 
>             '(buffer-menu-font-lock-keywords t))
>       (when (fboundp 'font-lock-refresh-defaults)
>         (font-lock-refresh-defaults)) ; WHY NEEDED NOW?
>       (turn-on-font-lock)
>       (when (and (fboundp 'fit-frame) (one-window-p t))
>         (fit-frame))
>       (raise-frame))))

> OK, so Emacs has apparently changed something about font-locking, so
> now you must refresh whenever you change the font-lock defaults.
> (Whenever?  Or maybe only sometimes when you change the defaults?)

I think that's pretty much always been necessary (as a general rule),
tho if the change is made before font-lock gets initialized, then of
course, there's nothing to refresh and the refresh is not needed, but
"when font-lock is initialized" is something that can depend on
*many* things.


        Stefan



reply via email to

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