bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26969: 26.0.50; diff-changed invisible by default


From: Stefan Monnier
Subject: bug#26969: 26.0.50; diff-changed invisible by default
Date: Wed, 17 May 2017 15:12:50 -0400

Package: Emacs
Version: 26.0.50

Nowadays the `diff-changed` face is defined to be "invisible" (i.e. the
text is displayed identically with or without that face).
IOW it can only be used as a parent of diff-added or diff-removed (or
some other such face).

This is a bad idea since in cases such as vdiff.el where some changes
are neither additions nor removals, it would make sense to highlight the
buffer as just "changed" and using that face is a natural choice.

I suggest the patch below for that.  It is designed such that it should
make no visible difference to users of diff-added and diff-removed since
these faces override the parts that are set by my patch in diff-changed.

Another option would be to introduce a new face (not sure how to call
it, maybe diff-unspecified-change, maybe?) which inherits from
diff-changed as well.


        Stefan


diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index aa8d77882e..1aa6c05662 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -290,9 +290,14 @@ diff-added
   :group 'diff-mode)
 
 (defface diff-changed
-  '((t nil))
+  '((((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 "25.1"
+  :version "26.1"
   :group 'diff-mode)
 
 (defface diff-indicator-removed





reply via email to

[Prev in Thread] Current Thread [Next in Thread]