]> git.eshelyaron.com Git - emacs.git/commitdiff
(jit-lock-fontify-now): Move jit-lock-context-unfontify-pos.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 17 Oct 2005 15:15:31 +0000 (15:15 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 17 Oct 2005 15:15:31 +0000 (15:15 +0000)
lisp/ChangeLog
lisp/jit-lock.el

index 370a32ae95e6416c1024a6f3784da0f6a6fc4f22..7f8cd2c7de51d3f736c8efc9f5f19218f704c95b 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * jit-lock.el (jit-lock-fontify-now):
+       Move jit-lock-context-unfontify-pos to avoid wasted work.
+
 2005-10-17  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-completion-mode): New defvar.  Used in
@@ -33,7 +38,7 @@
 
        * savehist.el: Don't require CL at runtime.
        (savehist-xemacs): Remove.
-       (savehist-coding-system): Use utf-8 if available, regardless of religion.
+       (savehist-coding-system): Use utf-8 if present, regardless of religion.
        (savehist-no-conversion): Use (featurep 'xemacs).
        (savehist-load): Check existence of start-itimer rather than XEmacs.
        Use an idle timer.
        * toolbar/gud-up.*: Moved to etc/images/gud/up.*.
        * toolbar/gud-watch.*: Moved to etc/images/gud/watch.*.
 
-       * progmodes/gud.el (gud-tool-bar-map): Renamed the images
+       * progmodes/gud.el (gud-tool-bar-map): Rename the images
        appropriately (for example, gud-break to gud/break).
 
 2005-10-14  Chong Yidong  <cyd@stupidchicken.com>
 
        * longlines.el (longlinges-search-function)
-       (longlines-search-forward, longlines-search-backward): New
-       functions.
+       (longlines-search-forward, longlines-search-backward): New functions.
        (longlines-mode): Set isearch-search-fun-function to
        longlinges-search-function.
 
index 2f8fcba91d1f2b689ae56ae294fa0a3400c36682..0a36b719ba166626dfd52a80e40c882fe123977d 100644 (file)
@@ -349,6 +349,16 @@ 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 jit-lock-context-unfontify-pos
+             (if (and (< jit-lock-context-unfontify-pos next)
+           (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)))
+             (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 +576,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