summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-10-17 15:15:31 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-10-17 15:15:31 +0000
commitc4ac63d08568c20cbcbed7e07335829bb392bd2f (patch)
tree91ee880545630ee71d54193cc4bcdbf6070af526 /lisp/jit-lock.el
parentc1bed3aa3acd17770292800c6827bd636495864d (diff)
downloademacs-c4ac63d08568c20cbcbed7e07335829bb392bd2f.tar.gz
(jit-lock-fontify-now): Move jit-lock-context-unfontify-pos.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 2f8fcba91d1..0a36b719ba1 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -349,6 +349,16 @@ Defaults to the whole buffer. END can be out of bounds."
(goto-char next) (setq next (line-beginning-position 2))
(goto-char start) (setq start (line-beginning-position))
+ ;; Make sure the contextual refontification doesn't re-refontify
+ ;; what's already been refontified.
+ (when jit-lock-context-unfontify-pos
+ (if (and (< jit-lock-context-unfontify-pos next)
+ (when (and jit-lock-context-unfontify-pos
+ (< jit-lock-context-unfontify-pos next)
+ (>= jit-lock-context-unfontify-pos start))
+ (setq jit-lock-context-unfontify-pos next)))
+ (setq jit-lock-context-unfontify-pos next))
+
;; Fontify the chunk, and mark it as fontified.
;; We mark it first, to make sure that we don't indefinitely
;; re-execute this fontification if an error occurs.
@@ -566,9 +576,14 @@ will take place when text is fontified stealthily."
;; Mark the change for deferred contextual refontification.
(when jit-lock-context-unfontify-pos
(setq jit-lock-context-unfontify-pos
+ ;; Here we use `start' because nothing guarantees that the
+ ;; text between start and end will be otherwise refontified:
+ ;; usually it will be refontified by virtue of being
+ ;; displayed, but if it's outside of any displayed area in the
+ ;; buffer, only jit-lock-context-* will re-fontify it.
(min jit-lock-context-unfontify-pos start))))))
(provide 'jit-lock)
-;;; arch-tag: 56b5de6e-f581-453b-bb97-49c39372ff9e
+;; arch-tag: 56b5de6e-f581-453b-bb97-49c39372ff9e
;;; jit-lock.el ends here