From: Lars Ingebrigtsen Date: Fri, 13 Aug 2021 13:35:49 +0000 (+0200) Subject: Add new face diff-changed-unspecified X-Git-Tag: emacs-28.0.90~1521 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d51c2c472963d6330925c06d59f16de370c6474;p=emacs.git Add new face diff-changed-unspecified * lisp/vc/diff-mode.el (diff-changed-unspecified): New face. (diff-font-lock-keywords): Use it (bug#26969). --- diff --git a/etc/NEWS b/etc/NEWS index 26ede715231..b40c2bd8f9e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2339,6 +2339,10 @@ a list. ** Diff +--- +*** New face 'diff-changed-unspecified'. +This is used when 'diff-use-changed-face' is non-nil. + --- *** New 'diff-mode' font locking face 'diff-error'. This face is used for error messages from 'diff'. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 4652afa1f92..1d838e66281 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -357,6 +357,16 @@ well." :foreground "green" :extend t)) "`diff-mode' face used to highlight added lines.") +(defface diff-changed-unspecified + '((((class color) (min-colors 88) (background light)) + :background "grey90") + (((class color) (min-colors 88) (background dark)) + :background "grey20") + (((class color)) + :foreground "grey")) + "`diff-mode' face used to highlight changed lines." + :version "28.1") + (defface diff-changed '((t nil)) "`diff-mode' face used to highlight changed lines." @@ -436,9 +446,10 @@ well." (defvar diff-use-changed-face (and (face-differs-from-default-p 'diff-changed) (not (face-equal 'diff-changed 'diff-added)) (not (face-equal 'diff-changed 'diff-removed))) - "If non-nil, use the face `diff-changed' for changed lines in context diffs. -Otherwise, use the face `diff-removed' for removed lines, -and the face `diff-added' for added lines.") + "Controls how changed lines are fontified in context diffs. +If non-nil, use the face `diff-changed-unspecified'. Otherwise, +use the face `diff-removed' for removed lines, and the face +`diff-added' for added lines.") (defvar diff-font-lock-keywords `((,(concat "\\(" diff-hunk-header-re-unified "\\)\\(.*\\)$") @@ -470,7 +481,7 @@ and the face `diff-added' for added lines.") diff-indicator-added-face diff-indicator-removed-face))))) (2 (if diff-use-changed-face - 'diff-changed + 'diff-changed-unspecified ;; Otherwise, use the same method as above. (save-match-data (let ((limit (save-excursion (diff-beginning-of-hunk))))