Function: jit-lock-stealth-chunk-start
jit-lock-stealth-chunk-start is a byte-compiled function defined in
jit-lock.el.gz.
Signature
(jit-lock-stealth-chunk-start AROUND)
Documentation
Return the start of the next chunk to fontify around position AROUND.
Value is nil if there is nothing more to fontify.
Source Code
;; Defined in /usr/src/emacs/lisp/jit-lock.el.gz
;;; Stealth fontification.
(defsubst jit-lock-stealth-chunk-start (around)
"Return the start of the next chunk to fontify around position AROUND.
Value is nil if there is nothing more to fontify."
(if (zerop (buffer-size))
nil
(let* ((next (text-property-not-all around (point-max) 'fontified t))
(prev (previous-single-property-change around 'fontified))
(prop (get-text-property (max (point-min) (1- around))
'fontified))
(start (cond
((null prev)
;; There is no property change between AROUND
;; and the start of the buffer. If PROP is
;; non-nil, everything in front of AROUND is
;; fontified, otherwise nothing is fontified.
(if (eq prop t)
nil
(max (point-min)
(- around (/ jit-lock-chunk-size 2)))))
((eq prop t)
;; PREV is the start of a region of fontified
;; text containing AROUND. Start fontifying a
;; chunk size before the end of the unfontified
;; region in front of that.
(max (or (previous-single-property-change prev 'fontified)
(point-min))
(- prev jit-lock-chunk-size)))
(t
;; PREV is the start of a region of unfontified
;; text containing AROUND. Start at PREV or
;; chunk size in front of AROUND, whichever is
;; nearer.
(max prev (- around jit-lock-chunk-size)))))
(result (cond ((null start) next)
((null next) start)
((< (- around start) (- next around)) start)
(t next))))
result)))