From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: About the :distant-foreground face attribute Date: Wed, 8 Jan 2014 08:57:53 -0800 (PST) Message-ID: <5816504e-66e3-4b30-898b-78c4b25941ac@default> References: <87bnzo9cja.fsf@gnu.org> <59B7E7FC-48D0-4737-B1BB-FFAC5BA9E07A@swipnet.se> <874n5f3162.fsf@gnu.org> <83fvozf86g.fsf@gnu.org> <87r48javwe.fsf@gnu.org> <5AAF847C-97BF-4BB6-A0A6-CAE665D7523E@swipnet.se> <87fvoy7qcp.fsf@gnu.org> <874n5ebka3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389200308 14885 80.91.229.3 (8 Jan 2014 16:58:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2014 16:58:28 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel To: Chong Yidong , =?utf-8?B?SmFuIERqw6Rydg==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 08 17:58:34 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W0wSb-0001OI-V6 for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 17:58:30 +0100 Original-Received: from localhost ([::1]:47797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0wSb-0003jc-Ll for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 11:58:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0wSQ-0003jW-1N for emacs-devel@gnu.org; Wed, 08 Jan 2014 11:58:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0wSH-0008N5-92 for emacs-devel@gnu.org; Wed, 08 Jan 2014 11:58:17 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:17467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0wS8-0008Je-3t; Wed, 08 Jan 2014 11:58:00 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s08GvvWQ023533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 Jan 2014 16:57:57 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s08Gvsai026244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Jan 2014 16:57:54 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s08Gvr2O029531; Wed, 8 Jan 2014 16:57:54 GMT In-Reply-To: <874n5ebka3.fsf@gnu.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:167750 Archived-At: The foreground attribute for a face should always reflect the actual appearance of that face (in isolation - this is not about the effects of combining faces etc.). Anything different from that is asking for trouble. IIUC, this change was made because on some platforms the default color for the `region' face background is inappropriate, given the default color for its foreground. To me, that sounds like the kind of thing that Eli recently declared to be not-an-Emacs-problem. But so be it - if Emacs can reasonably work around that problem, why not? If Emacs wants to make an attempt to compensate for that bad defaulting behavior, then I would think that the right approach would be to automatically tweak the color of the `region' face's foreground attribute itself. And preferably only for those situations where the problem actually arises. Adding a variable, as Yidong suggested, just spreads the pollution of this misguided fix across all faces. And it still does not sync the attribute value with the appearance. What the attribute says you should get is not what you get. The color is being changed behind the back of the face spec. If the face attribute value does not reflect the face appearance for an attribute, code that examines that attribute, e.g., to base its behavior on what the face's foreground is, will likely not DTRT. And code that modifies the face's foreground attribute will likewise likely not do what it is expected to do. Code becomes less transparent and dependable. Foreground attribute and actual foreground should be and remain one-to-one - no surprises (again, not counting face mergings etc.). Can't you please find a way to keep the foreground attribute in sync with the actual foreground color you need in this scenario? Can't you perform whatever machinations are needed to change the foreground attribute itself so that you get the visual effect needed? OK, so changing the attribute overrides whatever setting the user might fix for the attribute. But that would be done only when the problem arises. And it should be done only with the user's permission. IOW, I agree with Stefan (almost mentioned it myself) that users and Lisp code should be able, for whatever reason, to specify that the foreground and background for a given face are the exact same color. IOW, any automatic overriding of what the face definition specifies should be optional, under user control. And that user control should be *per face*. One should not be obliged to choose either preventing the overriding or allowing it for all faces. The choice should be a function of the particular face. Now *that* could be done using a new face attribute, if you want. (Or a function.) The important thing is to preserve the correspondence between each face's current appearance and its current attribute values.