Function: diff--font-lock-syntax

diff--font-lock-syntax is a byte-compiled function defined in diff-mode.el.gz.

Signature

(diff--font-lock-syntax MAX)

Documentation

Apply source language syntax highlighting from font-lock.

Calls diff-syntax-fontify on every hunk found between point and the position in MAX.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
;;; Syntax highlighting from font-lock

(defun diff--font-lock-syntax (max)
  "Apply source language syntax highlighting from font-lock.
Calls `diff-syntax-fontify' on every hunk found between point
and the position in MAX."
  (when diff-font-lock-syntax
    (when (get-char-property (point) 'diff--font-lock-syntax)
      (goto-char (next-single-char-property-change
                  (point) 'diff--font-lock-syntax nil max)))
    (diff--iterate-hunks
     max
     (lambda (beg end)
       (unless (get-char-property beg 'diff--font-lock-syntax)
         (diff-syntax-fontify beg end)
         (let ((ol (make-overlay beg end)))
           (overlay-put ol 'diff--font-lock-syntax t)
           (overlay-put ol 'diff-mode 'syntax)
           (overlay-put ol 'evaporate t)
           (overlay-put ol 'modification-hooks
                        '(diff--overlay-auto-delete))))))))