Function: jit-lock-function
jit-lock-function is a byte-compiled function defined in
jit-lock.el.gz.
Signature
(jit-lock-function START)
Documentation
Fontify current buffer starting at position START.
This function is added to fontification-functions when jit-lock-mode(var)/jit-lock-mode(fun)
is active.
Source Code
;; Defined in /usr/src/emacs/lisp/jit-lock.el.gz
;;; On demand fontification.
(defun jit-lock-function (start)
"Fontify current buffer starting at position START.
This function is added to `fontification-functions' when `jit-lock-mode'
is active."
(when (and jit-lock-mode (not memory-full))
(if (not (and jit-lock-defer-timer
(or (not (eq jit-lock-defer-time 0))
(input-pending-p))))
;; No deferral.
(let* ((cend (min (point-max) (+ start jit-lock-chunk-size)))
(vend (next-single-property-change start 'invisible nil cend)))
;; Presumably if we're called it means `start' is
;; not at EOB (nor invisible) and hence (> vend start).
(jit-lock-fontify-now start vend))
;; Record the buffer for later fontification.
(unless (memq (current-buffer) jit-lock-defer-buffers)
(push (current-buffer) jit-lock-defer-buffers))
;; Mark the area as defer-fontified so that the redisplay engine
;; is happy and so that the idle timer can find the places to fontify.
(with-silent-modifications
(put-text-property start
(next-single-property-change
start 'fontified nil
(min (point-max) (+ start jit-lock-chunk-size)))
'fontified 'defer)))))