summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-09-26 15:35:34 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-09-26 15:35:34 +0000
commitc18607470a2be92f7ff828121f3284ef116b756d (patch)
treeb2751eb70f3ce4fbc34470254bc90279b5679bb4 /lisp/jit-lock.el
parent444a42fd1090a5f90f7d272b12fee3a6c2b8b2eb (diff)
downloademacs-c18607470a2be92f7ff828121f3284ef116b756d.tar.gz
emacs-c18607470a2be92f7ff828121f3284ef116b756d.tar.bz2
emacs-c18607470a2be92f7ff828121f3284ef116b756d.zip
(jit-lock-fontify-now): Don't fontify the empty text.
(jit-lock-fontify-again): Don't refontify text that's not displayed.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 4cbc7da4511..612641d0954 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -349,7 +349,7 @@ Defaults to the whole buffer. END can be out of bounds."
;; Fontify chunks beginning at START. The end of a
;; chunk is either `end', or the start of a region
;; before `end' that has already been fontified.
- (while start
+ (while (and start (< start end))
;; Determine the end of this chunk.
(setq next (or (text-property-any start end 'fontified t)
end))
@@ -405,9 +405,11 @@ Defaults to the whole buffer. END can be out of bounds."
(defun jit-lock-fontify-again (buf start end)
"Fontify in buffer BUF from START to END."
- (with-current-buffer buf
- (with-buffer-prepared-for-jit-lock
- (put-text-property start end 'fontified t))))
+ ;; Don't bother refontifying text that's not even displayed.
+ (when (setq start (text-property-not-all start end 'fontified nil buf))
+ (with-current-buffer buf
+ (with-buffer-prepared-for-jit-lock
+ (put-text-property start end 'fontified nil)))))