Function: c-extend-after-change-region

c-extend-after-change-region is a byte-compiled function defined in cc-mode.el.gz.

Signature

(c-extend-after-change-region BEG END OLD-LEN)

Documentation

Extend the region to be fontified, if necessary.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
;; Emacs 22 and later.
(defun c-extend-after-change-region (beg end _old-len)
  "Extend the region to be fontified, if necessary."
  ;; Note: the parameter OLD-LEN is ignored here.  This somewhat indirect
  ;; implementation exists because it is minimally different from the
  ;; stand-alone CC Mode which, lacking
  ;; font-lock-extend-after-change-region-function, is forced to use advice
  ;; instead.
  ;;
  ;; Of the seven CC Mode languages, currently (2009-05) only C, C++, Objc
  ;; (the languages with #define) and AWK Mode make non-null use of this
  ;; function.
  (when (eq font-lock-support-mode 'jit-lock-mode)
    (save-restriction
      (widen)
      (c-save-buffer-state () ; Protect the undo-list from put-text-property.
	(if (< c-new-BEG beg)
	    (put-text-property c-new-BEG beg 'fontified nil))
	(if (> c-new-END end)
	    (put-text-property end c-new-END 'fontified nil)))))
  (cons c-new-BEG c-new-END))