changeset 46906:421ce085a3cc

(font-lock-mode): Add font-lock-unfontify-buffer to change-major-mode-hook when font lock is enabled.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Aug 2002 20:09:34 +0000
parents 23b6ab646d7b
children ce6e92081932
files lisp/font-core.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-core.el	Thu Aug 15 20:08:24 2002 +0000
+++ b/lisp/font-core.el	Thu Aug 15 20:09:34 2002 +0000
@@ -206,7 +206,11 @@
   ;; batch job) or if the buffer is invisible (the name starts with a space).
   (when (or noninteractive (eq (aref (buffer-name) 0) ?\ ))
     (setq font-lock-mode nil))
-  (funcall font-lock-function font-lock-mode))
+  (funcall font-lock-function font-lock-mode)
+  ;; Arrange to unfontify this buffer if we change major mode later.
+  (if font-lock-mode
+      (add-hook 'change-major-mode-hook 'font-lock-unfontify-buffer)
+    (remove-hook 'change-major-mode-hook 'font-lock-unfontify-buffer)))
 
 (defun font-lock-default-function (font-lock-mode)
   ;; Turn on Font Lock mode.