summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index a1287926eb9..bb2df2b1ffa 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -44,10 +44,13 @@ Preserves the `buffer-modified-p' state of the current buffer."
:version "21.1"
:group 'font-lock)
-(defcustom jit-lock-chunk-size 500
+(defcustom jit-lock-chunk-size 1500
"Jit-lock fontifies chunks of at most this many characters at a time.
-This variable controls both display-time and stealth fontification."
+This variable controls both `display-time' and stealth fontification.
+
+The optimum value is a little over the typical number of buffer
+characters which fit in a typical window."
:type 'integer)
@@ -150,7 +153,10 @@ If 0, then fontification is only deferred while there is input pending."
(defvar jit-lock-functions nil
"Special hook run to do the actual fontification.
The functions are called with two arguments:
-the START and END of the region to fontify.")
+the START and END of the region to fontify.
+Each function can return a list of the form (jit-lock-bounds BEG . END),
+to indicate the bounds of the region it actually fontified;
+JIT font-lock will use this information to optimize redisplay cycles.")
(defvar-local jit-lock-context-unfontify-pos nil
"Consider text after this position as contextually unfontified.
@@ -332,7 +338,10 @@ like `debug-on-error' and Edebug can be used."
"Register FUN as a fontification function to be called in this buffer.
FUN will be called with two arguments START and END indicating the region
that needs to be (re)fontified.
-If non-nil, CONTEXTUAL means that a contextual fontification would be useful."
+If non-nil, CONTEXTUAL means that a contextual fontification would be useful.
+FUN can return a list of the form (jit-lock-bounds BEG . END),
+to indicate the bounds of the region it actually fontified; JIT
+font-lock will use this information to optimize redisplay cycles."
(add-hook 'jit-lock-functions fun nil t)
(when (and contextual jit-lock-contextually)
(setq-local jit-lock-contextually t))