GNU bug report logs - #33567
Syntactic fontification of diff hunks

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sat, 1 Dec 2018 22:13:02 UTC

Severity: wishlist

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #112 received at 33567 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 33567 <at> debbugs.gnu.org
Subject: Re: bug#33567: Syntactic fontification of diff hunks
Date: Wed, 19 Dec 2018 03:35:39 +0200
On 19.12.2018 2:48, Dmitry Gutov wrote:
> On 19.12.2018 2:11, Juri Linkov wrote:
> 
>> Does it help to remove foreground colors from diff-added and 
>> diff-removed?
> 
> Yup. Except if I customize those and restart, I think the +'s and -'s on 
> the left will become black as well, which is somewhat of a loss.
(Maybe not on colorful enough displays, though).

Anyway, to be clear, and other considerations aside, this works:

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index ed953deb21..8a41e365da 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -304,9 +304,7 @@ diff-removed
     (((class color) (min-colors 88) (background light))
      :background "#ffdddd")
     (((class color) (min-colors 88) (background dark))
-     :background "#553333")
-    (((class color))
-     :foreground "red"))
+     :background "#553333"))
   "`diff-mode' face used to highlight removed lines.")

 (defface diff-added
@@ -315,9 +313,7 @@ diff-added
     (((class color) (min-colors 88) (background light))
      :background "#ddffdd")
     (((class color) (min-colors 88) (background dark))
-     :background "#335533")
-    (((class color))
-     :foreground "green"))
+     :background "#335533"))
   "`diff-mode' face used to highlight added lines.")

 (defface diff-changed
@@ -328,7 +324,9 @@ diff-changed
 (defface diff-indicator-removed
   '((default :inherit diff-removed)
     (((class color) (min-colors 88))
-     :foreground "#aa2222"))
+     :foreground "#aa2222")
+    (((class color))
+     :foreground "red"))
   "`diff-mode' face used to highlight indicator of removed lines (-, <)."
   :version "22.1")
 (defvar diff-indicator-removed-face 'diff-indicator-removed)
@@ -336,7 +334,9 @@ diff-indicator-removed-face
 (defface diff-indicator-added
   '((default :inherit diff-added)
     (((class color) (min-colors 88))
-     :foreground "#22aa22"))
+     :foreground "#22aa22")
+    (((class color))
+     :foreground "green"))
   "`diff-mode' face used to highlight indicator of added lines (+, >)."
   :version "22.1")
 (defvar diff-indicator-added-face 'diff-indicator-added)




This bug report was last modified 6 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.