From: Richard M. Stallman Date: Thu, 15 Aug 2002 20:09:34 +0000 (+0000) Subject: (font-lock-mode): Add font-lock-unfontify-buffer X-Git-Tag: ttn-vms-21-2-B4~13676 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8e97108f6bfaacb7574bc0d7835967a9aa0997fa;p=emacs.git (font-lock-mode): Add font-lock-unfontify-buffer to change-major-mode-hook when font lock is enabled. --- diff --git a/lisp/font-core.el b/lisp/font-core.el index ff0bec65902..6becb967954 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -206,7 +206,11 @@ your own function which is called when `font-lock-mode' is toggled via ;; 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.