From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46396: 27.1.90; Ediff's non-focused diff section, background too light in --reverse Date: Wed, 10 Feb 2021 19:01:21 +0200 Organization: LINKOV.NET Message-ID: <87blcs2f9q.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37624"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 46396@debbugs.gnu.org, bug-gnu-emacs_at_gnu.org@tangential.info To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 10 18:21:00 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9tAi-0009e1-CI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Feb 2021 18:21:00 +0100 Original-Received: from localhost ([::1]:46804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9tAh-00076h-4l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Feb 2021 12:20:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9stL-0004mO-P2 for bug-gnu-emacs@gnu.org; Wed, 10 Feb 2021 12:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9stL-0005cm-Fl for bug-gnu-emacs@gnu.org; Wed, 10 Feb 2021 12:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9stK-0001KG-B8 for bug-gnu-emacs@gnu.org; Wed, 10 Feb 2021 12:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Feb 2021 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46396 X-GNU-PR-Package: emacs Original-Received: via spool by 46396-submit@debbugs.gnu.org id=B46396.16129765755082 (code B ref 46396); Wed, 10 Feb 2021 17:03:02 +0000 Original-Received: (at 46396) by debbugs.gnu.org; 10 Feb 2021 17:02:55 +0000 Original-Received: from localhost ([127.0.0.1]:57142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9stC-0001Ju-T3 for submit@debbugs.gnu.org; Wed, 10 Feb 2021 12:02:55 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:58145) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9st9-0001Jb-Lt for 46396@debbugs.gnu.org; Wed, 10 Feb 2021 12:02:52 -0500 X-Originating-IP: 91.129.108.204 Original-Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 655C21C000B; Wed, 10 Feb 2021 17:02:42 +0000 (UTC) In-Reply-To: (Matt Armstrong's message of "Tue, 09 Feb 2021 23:24:35 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199787 Archived-At: --=-=-= Content-Type: text/plain > The origin of the faces without a foreground setting is commit > 382ceb2cdbedc06b06d9fb424d83f531339a3311 by Juri Linkov > while working on https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10181. > > I've cc'd him here. Juri, can you comment? Thanks for pointing me at this issue since I had not realized this is related to something affected by my previous changes. > I'm especially interested to hear your thoughts on why the change made > things nicer (what you said in > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10181#84). The core point of my 2014-year message was that with the specified foreground, Ediff removes font-lock highlighting on non-current differences. The need for keeping the font-lock foreground colors is evident when looking at these font-lock colors in buffers where the effect of font-lock is noticeable, such as changes in the source code files. But I completely agree that the current contrast is too low on a dark theme. Fortunately, now we have a feature that will help to fix this problem: the face attribute :distant-foreground specifies the alternative foreground color that is used only when the background color is too close to the foreground color, thus making the text readable in this case. > Or, perhaps the ediff faces should vary the background based on > (background light) and (background dark)? The background colors could be adjusted as well for dark backgrounds. After changing background colors to darker colors and adding :distant-foreground I tried different default foreground colors with M-x set-foreground-color RET dark grey RET and it seems everything looks readable. Do you see more problems with the following patch? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ediff-dark.patch diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 6e658163b9..3f33e6aae2 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -980,8 +980,10 @@ stipple-pixmap (defface ediff-even-diff-A `((((type pc)) (:foreground "green3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -999,8 +1001,10 @@ ediff-even-diff-face-A this variable represents.") (defface ediff-even-diff-B - `((((class color) (min-colors 88)) - (:background "Grey" :extend t)) + `((((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1019,8 +1023,10 @@ ediff-even-diff-face-B (defface ediff-even-diff-C `((((type pc)) (:foreground "yellow3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -1040,8 +1046,10 @@ ediff-even-diff-face-C (defface ediff-even-diff-Ancestor `((((type pc)) (:foreground "cyan3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1068,8 +1076,10 @@ ediff-even-diff-face-alist (defface ediff-odd-diff-A '((((type pc)) (:foreground "green3" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1088,8 +1098,10 @@ ediff-odd-diff-face-A (defface ediff-odd-diff-B '((((type pc)) (:foreground "White" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -1108,8 +1120,10 @@ ediff-odd-diff-face-B (defface ediff-odd-diff-C '((((type pc)) (:foreground "yellow3" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) --=-=-=--