emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0a3e2cf: * lisp/jit-lock.el (jit-lock-function): Do


From: Stefan Monnier
Subject: [Emacs-diffs] master 0a3e2cf: * lisp/jit-lock.el (jit-lock-function): Don't defer if jit-lock-defer-time
Date: Tue, 16 Dec 2014 14:26:06 +0000

branch: master
commit 0a3e2cfcbbf09abe6a550eeb1620a66a8e3d0245
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/jit-lock.el (jit-lock-function): Don't defer if jit-lock-defer-time
    is 0 and there is no input pending.
---
 lisp/ChangeLog   |    5 +++++
 lisp/jit-lock.el |    7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4f8631d..e7a44e8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-16  Stefan Monnier  <address@hidden>
+
+       * jit-lock.el (jit-lock-function): Don't defer if jit-lock-defer-time
+       is 0 and there is no input pending.
+
 2014-12-15  Juri Linkov  <address@hidden>
 
        * replace.el (query-replace-read-from): Use 
query-replace-compile-replacement
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 34f14a5..74bfa3a 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -125,7 +125,8 @@ The value of this variable is used when JIT Lock mode is 
turned on."
 
 (defcustom jit-lock-defer-time nil ;; 0.25
   "Idle time after which deferred fontification should take place.
-If nil, fontification is not deferred."
+If nil, fontification is not deferred.
+If 0, then fontification is only deferred while there is input pending."
   :group 'jit-lock
   :type '(choice (const :tag "never" nil)
                 (number :tag "seconds")))
@@ -333,7 +334,9 @@ Only applies to the current buffer."
 This function is added to `fontification-functions' when `jit-lock-mode'
 is active."
   (when (and jit-lock-mode (not memory-full))
-    (if (null jit-lock-defer-timer)
+    (if (not (and jit-lock-defer-timer
+                  (or (not (eq jit-lock-defer-time 0))
+                      (input-pending-p))))
        ;; No deferral.
        (jit-lock-fontify-now start (+ start jit-lock-chunk-size))
       ;; Record the buffer for later fontification.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]