changeset 29708:f37b857741b1

(jit-lock-mode): Force jit-refontify when turned on. Use consistent make-local-variable style for font-lock-fontified. (jit-lock-fontify-buffer): Don't bother checking for font-lock-mode and jit-lock-mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 17 Jun 2000 17:17:35 +0000
parents a70985b2a88f
children 69ac77ea153c
files lisp/jit-lock.el
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/jit-lock.el	Sat Jun 17 15:36:33 2000 +0000
+++ b/lisp/jit-lock.el	Sat Jun 17 17:17:35 2000 +0000
@@ -199,11 +199,14 @@
 
 	;; Turn Just-in-time Lock mode on.
 	(jit-lock-mode
+	 ;; Mark the buffer for refontification
+	 ;; (in case spurious `fontified' text-props were left around).
+	 (jit-lock-fontify-buffer)
+
 	 ;; Setting `font-lock-fontified' makes font-lock believe the
 	 ;; buffer is already fontified, so that it won't highlight
 	 ;; the whole buffer or bail out on a large buffer.
-	 (make-local-variable 'font-lock-fontified)
-	 (setq font-lock-fontified t)
+	 (set (make-local-variable 'font-lock-fontified) t)
 
 	 ;; Setup JIT font-lock-fontify-buffer.
 	 (unless jit-lock-saved-fontify-buffer-function
@@ -259,12 +262,10 @@
 ;; things like CWarn mode which adds/removes a few keywords and
 ;; does a refontify (which takes ages on large files).
 (defun jit-lock-fontify-buffer ()
-  (if (not (and font-lock-mode jit-lock-mode))
-      (funcall jit-lock-saved-fontify-buffer-function)
-    (with-buffer-prepared-for-font-lock
-     (save-restriction
-       (widen)
-       (add-text-properties (point-min) (point-max) '(fontified nil))))))
+  (with-buffer-prepared-for-font-lock
+   (save-restriction
+     (widen)
+     (add-text-properties (point-min) (point-max) '(fontified nil)))))
 
 
 ;;; On demand fontification.