• Juri Linkov's avatar
    Syntactic fontification of diff hunks (bug#33567) · 6973b148
    Juri Linkov authored
    * lisp/vc/diff-mode.el (diff-font-lock-syntax): New defcustom.
    (diff-default-directory): New buffer-local variable.
    (diff-indicator-removed, diff-indicator-added)
    (diff-indicator-changed): Set foreground to distinctive colors.
    (diff-context): Remove colors to make room for syntax highlighting.
    (diff-font-lock-keywords): Add diff--font-lock-syntax.
    (diff--font-lock-cleanup): Remove diff-mode syntax overlays.
    (diff--font-lock-syntax, diff--font-lock-syntax--refresh)
    (diff-syntax-fontify-revisions, diff-syntax-fontify-hunk)
    (diff-syntax-fontify-props): New functions.
    
    * lisp/vc/diff.el (diff-no-select): Set diff-default-directory to
    default-directory.
    
    * doc/emacs/files.texi (Diff Mode): Document diff-font-lock-syntax.
    6973b148
diff-mode.el 109 KB