[Top][All Lists]

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

Re: Diff mode faces

From: Juri Linkov
Subject: Re: Diff mode faces
Date: Tue, 12 Jul 2005 09:51:05 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>>  (defface diff-context
>> -  '((t :inherit shadow))
>> +  '((((class color) (min-colors 88)) :inherit shadow))
>>    "`diff-mode' face used to highlight context and other side-information."
>>    :group 'diff-mode)
> Maybe the shadow face should be fixed instead.

The shadow face should be fixed too (and perhaps not `instead').
Such a fix will affect faces which inherit from the shadow face
(like `tmm-inactive', `widget-inactive').

But as I understood from the discussion, `diff-mode' is exceptional:
on terminals where shades of grey are not available, it should
highlight changed lines, and not highlight context lines.

What makes `diff-mode' different from other modes with faces
inheriting from the shadow face, is that `diff-mode' has a special
face for changed lines (which currently is set to the color different
from the default foreground color on terminals), whereas other modes
have no special faces for highlighting the normal text (i.e. the text
other than highlighted with the shadow face).

Here is a new patch:

Index: lisp/faces.el
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.329
diff -u -r1.329 faces.el
--- lisp/faces.el       4 Jul 2005 23:08:54 -0000       1.329
+++ lisp/faces.el       12 Jul 2005 06:33:20 -0000
@@ -2149,8 +2148,10 @@
   :version "22.1")
 (defface shadow
-  '((((background dark))  :foreground "grey70")
-    (((background light)) :foreground "grey50"))
+  '((((min-colors 88) (background light)) :foreground "grey50")
+    (((min-colors 88) (background dark))  :foreground "grey70")
+    (((background light)) :foreground "green")
+    (((background dark)) :foreground "yellow"))
   "Basic face for shadowed text."
   :group 'basic-faces
   :version "22.1")

Index: lisp/diff-mode.el
RCS file: /cvsroot/emacs/emacs/lisp/diff-mode.el,v
retrieving revision 1.78
diff -u -r1.78 diff-mode.el
--- lisp/diff-mode.el   4 Jul 2005 23:08:52 -0000       1.78
+++ lisp/diff-mode.el   12 Jul 2005 06:35:03 -0000
@@ -259,7 +280,7 @@
 (defvar diff-function-face 'diff-function)
 (defface diff-context
-  '((t :inherit shadow))
+  '((((min-colors 88)) :inherit shadow))
   "`diff-mode' face used to highlight context and other side-information."
   :group 'diff-mode)
 ;; backward-compatibility alias

Juri Linkov

reply via email to

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