Function: font-lock-default-fontify-region

font-lock-default-fontify-region is a byte-compiled function defined in font-lock.el.gz.

Signature

(font-lock-default-fontify-region BEG END LOUDLY)

Documentation

Fontify the text between BEG and END.

If LOUDLY is non-nil, print status messages while fontifying. This function is the default font-lock-fontify-region-function.

Source Code

;; Defined in /usr/src/emacs/lisp/font-lock.el.gz
(defun font-lock-default-fontify-region (beg end loudly)
  "Fontify the text between BEG and END.
If LOUDLY is non-nil, print status messages while fontifying.
This function is the default `font-lock-fontify-region-function'."
  (save-buffer-state
   ;; Use the fontification syntax table, if any.
   (with-syntax-table (or font-lock-syntax-table (syntax-table))
     ;; Extend the region to fontify so that it starts and ends at
     ;; safe places.
     (let ((funs font-lock-extend-region-functions)
           (font-lock-beg beg)
           (font-lock-end end))
       (while funs
         (setq funs (if (or (not (funcall (car funs)))
                            (eq funs font-lock-extend-region-functions))
                        (cdr funs)
                      ;; If there's been a change, we should go through
                      ;; the list again since this new position may
                      ;; warrant a different answer from one of the fun
                      ;; we've already seen.
                      font-lock-extend-region-functions)))
       (setq beg font-lock-beg end font-lock-end))
     ;; Now do the fontification.
     (font-lock-unfontify-region beg end)
     (when (and font-lock-syntactic-keywords
                (null syntax-propertize-function))
       ;; Ensure the beginning of the file is properly syntactic-fontified.
       (let ((start beg))
         (when (< font-lock-syntactically-fontified start)
           (setq start (max font-lock-syntactically-fontified (point-min)))
           (setq font-lock-syntactically-fontified end))
         (font-lock-fontify-syntactic-keywords-region start end)))
     (unless font-lock-keywords-only
       (font-lock-fontify-syntactically-region beg end loudly))
     (font-lock-fontify-keywords-region beg end loudly)
     `(jit-lock-bounds ,beg . ,end))))