summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-06-17 17:17:35 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-06-17 17:17:35 +0000
commit5a5987eb6c004aa8fb23b39581bdf150924fa404 (patch)
tree2f379c20e387ad6f2388bf51428390690dc6d697
parentc2acf685ec1be2c05058cd5fcbe1211446501137 (diff)
downloademacs-5a5987eb6c004aa8fb23b39581bdf150924fa404.tar.gz
(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.
-rw-r--r--lisp/jit-lock.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index db41a15595f..0e1c8de8d61 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -199,11 +199,14 @@ the variable `jit-lock-stealth-nice'."
;; 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 @@ the variable `jit-lock-stealth-nice'."
;; 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.