]> code.delx.au - gnu-emacs/blobdiff - lisp/jit-lock.el
(unload-feature): Handle (t . SYMBOL) entries in load history.
[gnu-emacs] / lisp / jit-lock.el
index 612641d095485962f2ba271fe197e8cdd684a0a7..958bb679832d4d68c714c75cab1c6fa4584252dd 100644 (file)
@@ -1,7 +1,7 @@
 ;;; jit-lock.el --- just-in-time fontification
 
 ;; Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Keywords: faces files
@@ -397,19 +397,19 @@ 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 'jit-lock-fontify-again
+            (run-with-timer 0 nil 'jit-lock-force-redisplay
                             (current-buffer) start orig-start))
 
           ;; Find the start of the next chunk, if any.
           (setq start (text-property-any next end 'fontified nil))))))))
 
-(defun jit-lock-fontify-again (buf start end)
-  "Fontify in buffer BUF from START to END."
-  ;; Don't bother refontifying text that's not even displayed.
-  (when (setq start (text-property-not-all start end 'fontified nil buf))
-    (with-current-buffer buf
-      (with-buffer-prepared-for-jit-lock
-       (put-text-property start end 'fontified nil)))))
+(defun jit-lock-force-redisplay (buf start end)
+  "Force the display engine to re-render buffer BUF from START to END."
+  (with-current-buffer buf
+    (with-buffer-prepared-for-jit-lock
+     ;; Don't cause refontification (it's already been done), but just do
+     ;; some random buffer change, so as to force redisplay.
+     (put-text-property start end 'fontified t))))
 
 
 \f