summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-08-03 03:35:45 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-08-03 03:35:45 +0000
commit6b2fcbb546b8b69b2eef40c5042439d3f822bec7 (patch)
tree5ab2136cafe45731e02709ba11f93ecda7da84a8 /lisp/jit-lock.el
parent1200843820a76d33eeb0386cd617feec55a247f0 (diff)
downloademacs-6b2fcbb546b8b69b2eef40c5042439d3f822bec7.tar.gz
(jit-lock-fontify-now): Preserve the buffer's
modification status when forcing the second redisplay.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 7077d7880eb..4d7afe8c33f 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -31,6 +31,8 @@
(eval-when-compile
+ (require 'cl)
+
(defmacro with-buffer-unmodified (&rest body)
"Eval BODY, preserving the current buffer's modified state."
(declare (debug t))
@@ -384,10 +386,14 @@ Defaults to the whole buffer. END can be out of bounds."
;; eagerly extend the refontified region with
;; jit-lock-after-change-extend-region-functions.
(when (< start orig-start)
- (run-with-timer
- 0 nil `(lambda ()
- (put-text-property ',start ',orig-start
- 'fontified t ',(current-buffer)))))
+ (lexical-let ((start start)
+ (orig-start orig-start)
+ (buf (current-buffer)))
+ (run-with-timer
+ 0 nil (lambda ()
+ (with-buffer-prepared-for-jit-lock
+ (put-text-property start orig-start
+ 'fontified t buf))))))
;; Find the start of the next chunk, if any.
(setq start (text-property-any next end 'fontified nil))))))))