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

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

bug#10181: split `diff-refine-change' in several faces


From: Juri Linkov
Subject: bug#10181: split `diff-refine-change' in several faces
Date: Mon, 16 Jun 2014 09:55:31 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> Also this means that we don't need to use `shadow' on context lines anymore,
> because the differing lines are always highlighted by default.

Actually better to use the same color for context lines as used
on most other VCSes - #333333 for light backgrounds (its symmetric
color for dark backgrounds would be #dddddd):

=== modified file 'lisp/vc/diff-mode.el'
--- lisp/vc/diff-mode.el        2014-01-01 07:43:34 +0000
+++ lisp/vc/diff-mode.el        2014-06-16 06:54:30 +0000
@@ -343,7 +337,10 @@ (define-obsolete-face-alias 'diff-functi
 (defvar diff-function-face 'diff-function)
 
 (defface diff-context
-  '((((class color grayscale) (min-colors 88)) :inherit shadow))
+  '((((class color grayscale) (min-colors 88) (background light))
+     :foreground "#333333")
+    (((class color grayscale) (min-colors 88) (background dark))
+     :foreground "#dddddd"))
   "`diff-mode' face used to highlight context and other side-information."
   :group 'diff-mode)
 (define-obsolete-face-alias 'diff-context-face 'diff-context "22.1")


BTW, Ediff keeps font-lock highlighting while displaying the current hunk
that is good, but removes font-lock highlighting on non-current differences.
It would be much nicer to keep font-lock highlighting on these lines as well.
This patch does this by removing :foreground "White" and :foreground "Black"
from face definitions for min-colors 88, and keeps their :background colors:

=== modified file 'lisp/vc/ediff-init.el'
--- lisp/vc/ediff-init.el       2014-05-03 02:27:46 +0000
+++ lisp/vc/ediff-init.el       2014-06-16 06:54:34 +0000
@@ -949,7 +949,9 @@ (and (featurep 'xemacs)
 
 (defface ediff-current-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "VioletRed"))
+       (((class color) (min-colors 16))
         (:foreground "Black" :background "VioletRed"))
        (((class color))
         (:foreground "black" :background "magenta3"))
@@ -1057,7 +1059,9 @@ (ediff-hide-face ediff-fine-diff-face-C)
 
 (defface ediff-fine-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "Green"))
+       (((class color) (min-colors 16))
         (:foreground "Black" :background "Green"))
        (((class color))
         (:foreground "red3" :background "green"))
@@ -1091,6 +1095,8 @@ (defface ediff-even-diff-A
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "green3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1115,7 +1121,9 @@ (ediff-hide-face ediff-even-diff-face-A)
 
 (defface ediff-even-diff-B
   (if (featurep 'emacs)
-      `((((class color) (min-colors 16))
+      `((((class color) (min-colors 88))
+        (:background "Grey"))
+       (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
         (:foreground "blue3" :background "Grey" :weight bold))
@@ -1138,6 +1146,8 @@ (defface ediff-even-diff-C
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "yellow3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1164,6 +1174,8 @@ (defface ediff-even-diff-Ancestor
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "cyan3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1197,6 +1209,8 @@ (defface ediff-odd-diff-A
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "green3" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1222,6 +1236,8 @@ (defface ediff-odd-diff-B
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "White" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1246,6 +1262,8 @@ (defface ediff-odd-diff-C
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "yellow3" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1268,7 +1286,9 @@ (ediff-hide-face ediff-odd-diff-face-C)
 
 (defface ediff-odd-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "gray40"))
+       (((class color) (min-colors 16))
         (:foreground "cyan3" :background "gray40"))
        (((class color))
         (:foreground "green3" :background "black" :weight bold))






reply via email to

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