[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: font-lock-fontify-buffer removes highlighting in non font-lock buffe
From: |
Stefan Monnier |
Subject: |
Re: font-lock-fontify-buffer removes highlighting in non font-lock buffers |
Date: |
Thu, 22 Dec 2005 11:10:00 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> I see at least three solutions:
> * check font-lock-keywords in font-lock-default-function for the compiled
> empty value `(t nil)' and don't call font-lock-mode-internal for this
> value;
> I'd rather intervene at an earlier stage so that it is not compiled at all.
> Why not?
> * make the variable font-lock-keywords automatically buffer-local;
> That might be an ok solution.
OK, I think I found the problem:
in font-lock-default-fontify-buffer we do
(unless font-lock-mode
(font-lock-set-defaults))
where the idea is that if font-lock-mode is non-nil, it means font-lock is
already setup. But now that we have split font-lock-mode and
font-lock-mode-internal, that's not necessarily the case.
I installed the patch below which should fix the problem.
Stefan
--- font-lock.el 19 Dec 2005 23:18:17 -0000 1.287
+++ font-lock.el 22 Dec 2005 16:06:49 -0000
@@ -1001,8 +1001,7 @@
(when verbose
(format "Fontifying %s..." (buffer-name)))
;; Make sure we have the right `font-lock-keywords' etc.
- (unless font-lock-mode
- (font-lock-set-defaults))
+ (font-lock-set-defaults)
;; Make sure we fontify etc. in the whole buffer.
(save-restriction
(widen)