diff options
| -rw-r--r-- | lisp/font-lock.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index e1f35b179d3..9ce1ed1e8bc 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -365,14 +365,17 @@ can use \\[font-lock-fontify-buffer]." | |||
| 365 | (set (make-local-variable 'font-lock-mode) on-p) | 365 | (set (make-local-variable 'font-lock-mode) on-p) |
| 366 | (cond (on-p | 366 | (cond (on-p |
| 367 | (font-lock-set-defaults) | 367 | (font-lock-set-defaults) |
| 368 | (make-local-variable 'after-revert-hook) | ||
| 369 | ;;if buffer is reverted, must repeat fontification. | ||
| 370 | (setq after-revert-hook 'font-lock-fontify-buffer) | ||
| 368 | (run-hooks 'font-lock-mode-hook) | 371 | (run-hooks 'font-lock-mode-hook) |
| 369 | (or font-lock-fontified (font-lock-fontify-buffer))) | 372 | (or font-lock-fontified (font-lock-fontify-buffer))) |
| 370 | (font-lock-fontified | 373 | (font-lock-fontified |
| 371 | (setq font-lock-fontified nil) | 374 | (setq font-lock-fontified nil) |
| 375 | (setq after-revert-hook nil) | ||
| 372 | (font-lock-unfontify-region (point-min) (point-max)))) | 376 | (font-lock-unfontify-region (point-min) (point-max)))) |
| 373 | (force-mode-line-update))) | 377 | (force-mode-line-update))) |
| 374 | 378 | ||
| 375 | |||
| 376 | (defun font-lock-fontify-buffer () | 379 | (defun font-lock-fontify-buffer () |
| 377 | "Fontify the current buffer the way `font-lock-mode' would: | 380 | "Fontify the current buffer the way `font-lock-mode' would: |
| 378 | 381 | ||