diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-21 15:58:32 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-21 15:58:32 +0200 |
commit | 4a8d3d81cfc3e26dfb5eafd4af1c6a5a73fca8aa (patch) | |
tree | 97c9322c62b107b4ca3ea6c6e96c566950a22d72 /lisp | |
parent | 9d0385d7c7adc810dfd06321b783593b7afb3d58 (diff) | |
download | emacs-4a8d3d81cfc3e26dfb5eafd4af1c6a5a73fca8aa.tar.gz |
Highlight error messages from diff in diff-mode
* lisp/vc/diff-mode.el (diff-error): New face (bug#2739).
(diff-font-lock-keywords): Use it to highlight lines like "diff: "
which are error messages from diff (for instance, when a file
doesn't exist).
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/vc/diff-mode.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index aff20b6e6e9..9c41d508b6b 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -392,6 +392,12 @@ well." '((t :inherit diff-file-header)) "`diff-mode' face used to highlight nonexistent files in recursive diffs.") +(defface diff-error + '((((class color)) + :foreground "red" :background "black" :weight bold) + (t :weight bold)) + "`diff-mode' face for error messages from diff.") + (defconst diff-yank-handler '(diff-yank-function)) (defun diff-yank-function (text) ;; FIXME: the yank-handler is now called separately on each piece of text @@ -472,6 +478,7 @@ and the face `diff-added' for added lines.") ("^\\(#\\)\\(.*\\)" (1 font-lock-comment-delimiter-face) (2 font-lock-comment-face)) + ("^diff: .*" (0 'diff-error)) ("^[^-=+*!<>#].*\n" (0 'diff-context)) (,#'diff--font-lock-syntax) (,#'diff--font-lock-prettify) |