Function: font-lock-after-change-function

font-lock-after-change-function is a byte-compiled function defined in font-lock.el.gz.

Signature

(font-lock-after-change-function BEG END &optional OLD-LEN)

Source Code

;; Defined in /usr/src/emacs/lisp/font-lock.el.gz
;; Called when any modification is made to buffer text.
(defun font-lock-after-change-function (beg end &optional old-len)
  (save-excursion
    (let ((inhibit-quit t)
          (region (if font-lock-extend-after-change-region-function
                      (funcall font-lock-extend-after-change-region-function
                               beg end old-len))))
      (save-match-data
	(if region
	    ;; Fontify the region the major mode has specified.
	    (setq beg (car region) end (cdr region))
	  ;; Fontify the whole lines which enclose the region.
          ;; Actually, this is not needed because
          ;; font-lock-default-fontify-region already rounds up to a whole
          ;; number of lines.
	  ;; (setq beg (progn (goto-char beg) (line-beginning-position))
	  ;;       end (progn (goto-char end) (line-beginning-position 2)))
	  (unless (eq end (point-max))
	    ;; Rounding up to a whole number of lines should include the
	    ;; line right after `end'.  Typical case: the first char of
	    ;; the line was deleted.  Or a \n was inserted in the middle
	    ;; of a line.
	    (setq end (1+ end))))
	(font-lock-fontify-region beg end)))))