From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tina Russell Newsgroups: gmane.emacs.bugs Subject: bug#34001: 26.1.90; :distant-foreground face property fails to work in most cases Date: Sun, 6 Jan 2019 14:31:51 -0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006c27dd057ed1ae37" X-Trace: blaine.gmane.org 1546815253 15297 195.159.176.226 (6 Jan 2019 22:54:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 6 Jan 2019 22:54:13 +0000 (UTC) To: 34001@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 23:54:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggHJ2-0003s1-UC for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 23:54:09 +0100 Original-Received: from localhost ([127.0.0.1]:51738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggHL9-0000rf-Ci for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 17:56:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggHKy-0000p5-GW for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:56:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggHKu-0008IJ-IX for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:56:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggHKs-0008HZ-Mc for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggHKs-0002KS-Ji for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tina Russell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jan 2019 22:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34001 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15468153338911 (code B ref -1); Sun, 06 Jan 2019 22:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jan 2019 22:55:33 +0000 Original-Received: from localhost ([127.0.0.1]:47424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggHKP-0002Jf-5a for submit@debbugs.gnu.org; Sun, 06 Jan 2019 17:55:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggGxp-0001mR-Gi for submit@debbugs.gnu.org; Sun, 06 Jan 2019 17:32:14 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggGxk-0000yW-AL for submit@debbugs.gnu.org; Sun, 06 Jan 2019 17:32:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggGxj-0000E5-3m for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:32:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggGxi-0000xV-0F for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:32:07 -0500 Original-Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:35037) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggGxh-0000we-Ou for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2019 17:32:05 -0500 Original-Received: by mail-lf1-x133.google.com with SMTP id e26so28849006lfc.2 for ; Sun, 06 Jan 2019 14:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5ujmUdK3IcGd+aRwv4WXluvL52SmRbhSGnJTEGij9Wo=; b=JnzMKrHnQrCmvWyaoiCnEQyOeN0AszPqXCjkaNZ7nqj90Xn1eBFKkN8pMqx/lyFW7Q bSobMII8MhCzPuX9s7gPbNyKvvKhhhKnv45ilO/o4mQm2xl1im+qqpn9gScSTW9tlVHR hV4EtnVjFP4RgK1orFQZb5ws+dkKIoZZTu6Z6yAZzzlToxglsLE7626lkBQQrZCqvUOn 0dt7da9MYV/Wp3eo3CFAE2JYywBc740rzZW3y14vwtOYviAiOTWkgvao6RipLDC2tIKq 1AINuLRTYZUuITIaaL7SZu6uEXUlzcVbVx6ybybuM6cCPiYmbzn1BcH0u5iaxA5NSCm6 qefg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5ujmUdK3IcGd+aRwv4WXluvL52SmRbhSGnJTEGij9Wo=; b=cDOuSX7LfeRjBfZA749YcRYX/ficDWtIV7Wn/EzZ9ssq0DJf5ZUuzsDFFkK7ypr1jV /lpK0kqD9ajiWNkHMgwDfS13wxjAP57unMNEEM6dlEgs36aoNwjmiqs4UAibWayy2pZw 8GI38w47SWzeTO9wr7f++hCsynncUV0ZqTZTBiTNlGAC/jSfaXFuVyd/Ui9PMuocNcH5 zEZ0rVaLmpQ1qghoJ2EjShSzZ8IdDrut9b5vTiMSkoI0lzVhZT0sQB0Nd8EuIVE5qV8V Yzu2ZDOT5oqPF2afzvnNzyjpXzwMPYpKIvlFrFwst6ixliKb/9QVP94mA+/O7sSmiFct Sdbw== X-Gm-Message-State: AA+aEWaK2uxqjJCGFxYfF5QOkxQPz50JQbf0RtxxW+8VbH7UxQVgEQYB i9LslLeKlULiMNPH8xDoF0gqoRnRDYN81Qm6Ma3yR118 X-Google-Smtp-Source: AFSGD/WfBVmobXK1tgxLMDFT+Nd0bGWgwx1URznmiCNllKqhE1MzBqlvwP/J/I7Rf7kYnrZa2HYDkgg9DWje90Gu368= X-Received: by 2002:a19:41c4:: with SMTP id o187mr31037306lfa.32.1546813923139; Sun, 06 Jan 2019 14:32:03 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sun, 06 Jan 2019 17:55:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154204 Archived-At: --0000000000006c27dd057ed1ae37 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable :distant-foreground is a very useful concept for a face property: text will be rendered with the :foreground color, unless it=E2=80=99s too close = to the current background color, in which case :distant-foreground kicks in. Like, try this in Eshell or IELM: (propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground "yellow" :background "yellow")) You=E2=80=99ll get a solid band of yellow, of course. But, with :distant-foreground=E2=80=A6 (propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground "yellow" :background "yellow" :distant-foreground "black")) Now it is a friendly greeting. (Naturally, you wouldn=E2=80=99t normally se= t :background and :distant-foreground in the same face, this is just an example.) But, try this: (propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground "yellow" :background "white" :distant-foreground "black")) :distant-foreground doesn=E2=80=99t kick in=E2=80=94and you=E2=80=99re left= with yellow-on-white text that=E2=80=99s impossible to read, the exact scenario that :distant-foreground was quite rightly designed to avoid. I=E2=80=99m not the only one who=E2=80=99s noticed this; there=E2=80=99s a = good StackExchange thread from 2015 here: https://emacs.stackexchange.com/questions/7982/ The author notes that there should be a user option to set the amount of =E2=80=9Cdistance=E2=80= =9D (between foreground and background colors) that is required for distant-foreground to kick in, and adds that a good way to measure color distance in real-world circumstances is described here: http://web.mst.edu/~rhall/web_design/color_readability.html A commenter suggested that he file a bug, but I can=E2=80=99t find an Emacs bug report related to this issue, so I=E2=80=99m filing this now. I really hope this gets addressed, because :distant-foreground is a really nice and clever feature. Thanks! In GNU Emacs 26.1.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-01-02 built on pannychis Repository revision: 08840f2f7bfc6144bd163dd85efe87d28541e425 Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.1 LTS Configured using: 'configure --with-xaw3d --with-modules --with-xwidgets' --0000000000006c27dd057ed1ae37 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
:distant-foreground is a very useful concept for a face pr= operty: text
will be rendered with the :foreground color, unless it=E2= =80=99s too close to
the current background color, in which case :distan= t-foreground kicks
in. Like, try this in Eshell or IELM:

(propert= ize "Greetings, esteemed Emacs developers!" 'face '(:fore= ground
"yellow" :background "yellow"))

You=E2= =80=99ll get a solid band of yellow, of course. But, with
:distant-foreg= round=E2=80=A6

(propertize "Greetings, esteemed Emacs developer= s!" 'face '(:foreground
"yellow" :background &quo= t;yellow" :distant-foreground "black"))

Now it is a f= riendly greeting. (Naturally, you wouldn=E2=80=99t normally set
:backgro= und and :distant-foreground in the same face, this is just an
example.)<= br>
But, try this:

(propertize "Greetings, esteemed Emacs de= velopers!" 'face '(:foreground
"yellow" :backgrou= nd "white" :distant-foreground "black"))

:distan= t-foreground doesn=E2=80=99t kick in=E2=80=94and you=E2=80=99re left with y= ellow-on-white
text that=E2=80=99s impossible to read, the exact scenari= o that
:distant-foreground was quite rightly designed to avoid.

I= =E2=80=99m not the only one who=E2=80=99s noticed this; there=E2=80=99s a g= ood StackExchange
thread from 2015 here:
https://emacs.stackexchange.com/questions/7= 982/ The author notes that
there should be a user option to set the = amount of =E2=80=9Cdistance=E2=80=9D (between
foreground and background = colors) that is required for
distant-foreground to kick in, and adds tha= t a good way to measure
color distance in real-world circumstances is de= scribed here:
http://web.mst.edu/~rhall/web_design/color_readability.html A commenter
suggested that he file a bug, but I can=E2=80=99t find an= Emacs bug report
related to this issue, so I=E2=80=99m filing this now.=

I really hope this gets addressed, because :distant-foreground is a=
really nice and clever feature. Thanks!

In GNU Emacs 26.1.90 (bu= ild 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
=C2=A0of 2019-01-02 bu= ilt on pannychis
Repository revision: 08840f2f7bfc6144bd163dd85efe87d285= 41e425
Windowing system distributor 'The X.Org Foundation', vers= ion 11.0.11906000
System Description: Ubuntu 18.04.1 LTS

Configur= ed using:
=C2=A0'configure --with-xaw3d --with-modules --with-xwidge= ts'
--0000000000006c27dd057ed1ae37--