summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-12-16 09:25:57 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-12-16 09:25:57 -0500
commit0a3e2cfcbbf09abe6a550eeb1620a66a8e3d0245 (patch)
tree46b9134a7c20c227f7a1c144fa412f6216a4e624 /lisp/jit-lock.el
parent15426191a1353ac208d8ebe4a5920228e0df41a4 (diff)
downloademacs-0a3e2cfcbbf09abe6a550eeb1620a66a8e3d0245.tar.gz
* lisp/jit-lock.el (jit-lock-function): Don't defer if jit-lock-defer-time
is 0 and there is no input pending.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 34f14a5af63..74bfa3ab078 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.