diff options
| author | Richard M. Stallman | 2002-08-15 20:09:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-08-15 20:09:34 +0000 |
| commit | 8e97108f6bfaacb7574bc0d7835967a9aa0997fa (patch) | |
| tree | 0a8b86134881a7cc4e058f75fb52a13544ee7008 | |
| parent | 64d18e8f147643d45dc05ba227bf9a5fab84adf0 (diff) | |
| download | emacs-8e97108f6bfaacb7574bc0d7835967a9aa0997fa.tar.gz emacs-8e97108f6bfaacb7574bc0d7835967a9aa0997fa.zip | |
(font-lock-mode): Add font-lock-unfontify-buffer
to change-major-mode-hook when font lock is enabled.
| -rw-r--r-- | lisp/font-core.el | 6 |
1 files changed, 5 insertions, 1 deletions
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 | |||
| 206 | ;; batch job) or if the buffer is invisible (the name starts with a space). | 206 | ;; batch job) or if the buffer is invisible (the name starts with a space). |
| 207 | (when (or noninteractive (eq (aref (buffer-name) 0) ?\ )) | 207 | (when (or noninteractive (eq (aref (buffer-name) 0) ?\ )) |
| 208 | (setq font-lock-mode nil)) | 208 | (setq font-lock-mode nil)) |
| 209 | (funcall font-lock-function font-lock-mode)) | 209 | (funcall font-lock-function font-lock-mode) |
| 210 | ;; Arrange to unfontify this buffer if we change major mode later. | ||
| 211 | (if font-lock-mode | ||
| 212 | (add-hook 'change-major-mode-hook 'font-lock-unfontify-buffer) | ||
| 213 | (remove-hook 'change-major-mode-hook 'font-lock-unfontify-buffer))) | ||
| 210 | 214 | ||
| 211 | (defun font-lock-default-function (font-lock-mode) | 215 | (defun font-lock-default-function (font-lock-mode) |
| 212 | ;; Turn on Font Lock mode. | 216 | ;; Turn on Font Lock mode. |