diff options
| author | Stefan Monnier | 2006-08-03 03:35:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-08-03 03:35:45 +0000 |
| commit | 6b2fcbb546b8b69b2eef40c5042439d3f822bec7 (patch) | |
| tree | 5ab2136cafe45731e02709ba11f93ecda7da84a8 /lisp | |
| parent | 1200843820a76d33eeb0386cd617feec55a247f0 (diff) | |
| download | emacs-6b2fcbb546b8b69b2eef40c5042439d3f822bec7.tar.gz emacs-6b2fcbb546b8b69b2eef40c5042439d3f822bec7.zip | |
(jit-lock-fontify-now): Preserve the buffer's
modification status when forcing the second redisplay.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/jit-lock.el | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc624acb0be..a92c989b9b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2006-08-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * jit-lock.el (jit-lock-fontify-now): Preserve the buffer's | ||
| 4 | modification status when forcing the second redisplay. | ||
| 5 | |||
| 1 | 2006-08-03 Kim F. Storm <storm@cua.dk> | 6 | 2006-08-03 Kim F. Storm <storm@cua.dk> |
| 2 | 7 | ||
| 3 | * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame. | 8 | * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame. |
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 @@ | |||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | (eval-when-compile | 33 | (eval-when-compile |
| 34 | (require 'cl) | ||
| 35 | |||
| 34 | (defmacro with-buffer-unmodified (&rest body) | 36 | (defmacro with-buffer-unmodified (&rest body) |
| 35 | "Eval BODY, preserving the current buffer's modified state." | 37 | "Eval BODY, preserving the current buffer's modified state." |
| 36 | (declare (debug t)) | 38 | (declare (debug t)) |
| @@ -384,10 +386,14 @@ Defaults to the whole buffer. END can be out of bounds." | |||
| 384 | ;; eagerly extend the refontified region with | 386 | ;; eagerly extend the refontified region with |
| 385 | ;; jit-lock-after-change-extend-region-functions. | 387 | ;; jit-lock-after-change-extend-region-functions. |
| 386 | (when (< start orig-start) | 388 | (when (< start orig-start) |
| 387 | (run-with-timer | 389 | (lexical-let ((start start) |
| 388 | 0 nil `(lambda () | 390 | (orig-start orig-start) |
| 389 | (put-text-property ',start ',orig-start | 391 | (buf (current-buffer))) |
| 390 | 'fontified t ',(current-buffer))))) | 392 | (run-with-timer |
| 393 | 0 nil (lambda () | ||
| 394 | (with-buffer-prepared-for-jit-lock | ||
| 395 | (put-text-property start orig-start | ||
| 396 | 'fontified t buf)))))) | ||
| 391 | 397 | ||
| 392 | ;; Find the start of the next chunk, if any. | 398 | ;; Find the start of the next chunk, if any. |
| 393 | (setq start (text-property-any next end 'fontified nil)))))))) | 399 | (setq start (text-property-any next end 'fontified nil)))))))) |