summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-01-16 06:59:21 +0000
committerMiles Bader <miles@gnu.org>2006-01-16 06:59:21 +0000
commit6a2bd1a5019d2130c87ac5cf17f1322bf614b624 (patch)
tree8e72a4a1b7c177b494ae7721f00ea27b14f9f439 /lisp/jit-lock.el
parent5bb51be51248803e7400837b83c711854fa86648 (diff)
parent292f71fe67394186e943783bef808c611699b63c (diff)
downloademacs-6a2bd1a5019d2130c87ac5cf17f1322bf614b624.tar.gz
emacs-6a2bd1a5019d2130c87ac5cf17f1322bf614b624.tar.bz2
emacs-6a2bd1a5019d2130c87ac5cf17f1322bf614b624.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-95
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 598-615) - Update from CVS - Remove lisp/toolbar directory - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 142-146) - Update from CVS
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 2f8fcba91d1..b76c675cba4 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -349,6 +349,13 @@ 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 (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))
+
;; 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 +573,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