Function: jit-lock-after-change
jit-lock-after-change is a byte-compiled function defined in
jit-lock.el.gz.
Signature
(jit-lock-after-change START END OLD-LEN)
Documentation
Mark the rest of the buffer as not fontified after a change.
Installed on after-change-functions.
START and END are the start and end of the changed text. OLD-LEN
is the pre-change length.
This function ensures that lines following the change will be refontified
in case the syntax of those lines has changed. Refontification
will take place when text is fontified stealthily.
Source Code
;; Defined in /usr/src/emacs/lisp/jit-lock.el.gz
(defun jit-lock-after-change (start end old-len)
"Mark the rest of the buffer as not fontified after a change.
Installed on `after-change-functions'.
START and END are the start and end of the changed text. OLD-LEN
is the pre-change length.
This function ensures that lines following the change will be refontified
in case the syntax of those lines has changed. Refontification
will take place when text is fontified stealthily."
(when (and jit-lock-mode (not memory-full))
(let ((jit-lock-start start)
(jit-lock-end end))
(with-silent-modifications
(run-hook-with-args 'jit-lock-after-change-extend-region-functions
start end old-len)
;; Make sure we change at least one char (in case of deletions).
(setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max)))
;; Request refontification.
(save-restriction
(widen)
(put-text-property jit-lock-start jit-lock-end 'fontified nil)))
;; Mark the change for deferred contextual refontification.
(when jit-lock-context-unfontify-pos
(setq jit-lock-context-unfontify-pos
;; Here we use `start' because nothing guarantees that the
;; text between start and end will be otherwise refontified:
;; usually it will be refontified by virtue of being
;; displayed, but if it's outside of any displayed area in the
;; buffer, only jit-lock-context-* will re-fontify it.
(min jit-lock-context-unfontify-pos jit-lock-start))))))