Function: font-lock-extend-region-multiline

font-lock-extend-region-multiline is a byte-compiled function defined in font-lock.el.gz.

Signature

(font-lock-extend-region-multiline)

Documentation

Move fontification boundaries away from any font-lock-multiline property.

Source Code

;; Defined in /usr/src/emacs/lisp/font-lock.el.gz
;; Mark it as a special hook which doesn't use any global setting
;; (i.e. doesn't obey the element t in the buffer-local value).

(defun font-lock-extend-region-multiline ()
  "Move fontification boundaries away from any `font-lock-multiline' property."
  (let ((changed nil))
    (when (and (> font-lock-beg (point-min))
               (get-text-property (1- font-lock-beg) 'font-lock-multiline))
      (setq changed t)
      (setq font-lock-beg (or (previous-single-property-change
                               font-lock-beg 'font-lock-multiline)
                              (point-min))))
    ;; If `font-lock-multiline' starts at `font-lock-end', do not
    ;; extend the region.
    (let ((before-end (max (point-min) (1- font-lock-end)))
          (new-end nil))
      (when (get-text-property before-end 'font-lock-multiline)
        (setq new-end (or (text-property-any before-end (point-max)
                                             'font-lock-multiline nil)
                          (point-max)))
        (when (/= new-end font-lock-end)
          (setq changed t)
          (setq font-lock-end new-end))))
    changed))