# HG changeset patch # User Stefan Monnier # Date 1154576145 0 # Node ID a1a0b1eed3a87213db299096d002e37a35170be9 # Parent 2d16125405b4f0c2dd850f82f54f623f77d1ea9f (jit-lock-fontify-now): Preserve the buffer's modification status when forcing the second redisplay. diff -r 2d16125405b4 -r a1a0b1eed3a8 lisp/ChangeLog --- a/lisp/ChangeLog Wed Aug 02 22:51:44 2006 +0000 +++ b/lisp/ChangeLog Thu Aug 03 03:35:45 2006 +0000 @@ -1,3 +1,8 @@ +2006-08-02 Stefan Monnier + + * jit-lock.el (jit-lock-fontify-now): Preserve the buffer's + modification status when forcing the second redisplay. + 2006-08-03 Kim F. Storm * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame. diff -r 2d16125405b4 -r a1a0b1eed3a8 lisp/jit-lock.el --- a/lisp/jit-lock.el Wed Aug 02 22:51:44 2006 +0000 +++ b/lisp/jit-lock.el Thu Aug 03 03:35:45 2006 +0000 @@ -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 @@ ;; 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))))))))