From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: About the :distant-foreground face attribute Date: Tue, 14 Jan 2014 08:47:53 +0100 Message-ID: <52D4EBA9.8050802@swipnet.se> References: <87bnzo9cja.fsf@gnu.org> <59B7E7FC-48D0-4737-B1BB-FFAC5BA9E07A@swipnet.se> <874n5f3162.fsf@gnu.org> <83fvozf86g.fsf@gnu.org> <87r48javwe.fsf@gnu.org> <83bnzmfjxe.fsf@gnu.org> <52D3E689.6050902@dancol.org> <8E16225F-53EF-498A-AB35-66EB9B33B859@swipnet.se> <52D43360.6050605@dancol.org> <9BD01B88-AF13-44DD-8DBE-4598BAC136DD@swipnet.se> <52D45C73.6090906@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1389685705 10883 80.91.229.3 (14 Jan 2014 07:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jan 2014 07:48:25 +0000 (UTC) Cc: Eli Zaretskii , Chong Yidong , emacs-devel To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 14 08:48:31 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 1W2yje-0005va-VK for ged-emacs-devel@m.gmane.org; Tue, 14 Jan 2014 08:48:31 +0100 Original-Received: from localhost ([::1]:46919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2yje-0006Vz-Ii for ged-emacs-devel@m.gmane.org; Tue, 14 Jan 2014 02:48:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2yjT-0006IN-6Y for emacs-devel@gnu.org; Tue, 14 Jan 2014 02:48:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2yjL-0003g7-Vm for emacs-devel@gnu.org; Tue, 14 Jan 2014 02:48:19 -0500 Original-Received: from mailfe02.swip.net ([212.247.154.33]:60999 helo=swip.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2yj6-0003eZ-Jf; Tue, 14 Jan 2014 02:47:56 -0500 X-T2-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 Original-Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 468951304; Tue, 14 Jan 2014 08:47:52 +0100 Original-Received: from jdvpro.hq.ismobile.com (unknown [176.57.193.190]) (Authenticated sender: jhd) by hosdjarv.se (Postfix) with ESMTPSA id 8C6721A0587; Tue, 14 Jan 2014 07:47:52 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: <52D45C73.6090906@dancol.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.247.154.33 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:168340 Archived-At: Hello. Your mailer does not quote replies properly, which is distracting. Can you fix that? Daniel Colascione skrev 2014-01-13 22:36: > On 01/13/2014 01:29 PM, Jan Djärv wrote: >> 13 jan 2014 kl. 19:41 skrev Daniel Colascione : >> >>> On 01/13/2014 08:33 AM, Jan Djärv wrote: >>>> 13 jan 2014 kl. 14:13 skrev Daniel Colascione : >>>>> The patch uses the CIE L*A*B colorspace algorithm by default. >>>> >>>> Do not change the defaults please. Reinstate the >>>> *_selection_fg_color. >>>> They are system defined and should be honored. >>> >>> There are two sane defaults: the 24.3 behavior, where we always use >>> the system selection foreground and background, and my proposed >>> behavior, where we use the fontified foreground and automatically >>> adjust it so that it's legible. The current behavior is worse because >>> it uses the system selection foreground only sometimes and doesn't >>> preserve theme hues when possible. >> >> What theme hues? The default theme is not really a theme as >> selection > colors are taken from system settings. And this is correct IMHO, any > application that doesn't do so by default (i.e. no user configuration > has been set in the application) is seriously broken. > > Yes, but font-lock colors are specified with explicit colors (even in > the default "theme"), and we want to preserve these even in the presence > of a selection. We are *already* not honoring the system-specified > foreground selection color. At the same time, we want to make sure that > highlighted text is legible against a background of whatever the system > selection color happens to be. The best way to do that is to > automatically shift the foreground colors in value, but not hue, so that > they remain legible while being recognizably the same color. Given the use case at hand, we know for a fact that the background is the region background, so I don't understand why a calculated foreground is needed. Just pick one that matches the background. There might be other use cases where a calculated foreground makes sense, but my imagination fails me here. > I would also support a scheme where, by default, 'region' sets > foreground *and* background colors to the system selection colors and > other faces don't show through. But we didn't decide to go in that > direction. FWIW, here Eclipse, XCode and Visual Studio all shows the (equivalent of) foreground color from font lock face and background from region when selecting text with the mouse, so it is not as Eamcs is breaking new ground here. > >> If you talk about other themes, they can set :distant-foreground to >> a > real color of their choosing and not rely on some automatically > generated one which most probably don't fit the theme anyway. > Automatically generated colors are a crutch which should be avoided if > possible, certainly not recommended. > > There's no way that themes can take into account all the possible colors > users and packages might use. Automatic contrast adjustment can do that. Again, I really don't see this use case. Do you have one? > > If you want the :distant-foreground behavior, it can be accommodated in > this patch. This patch also permits other schemes that some users might > find more useful. I know that, this is just about defaults. > We should push policy to user customization when > possible instead of hardcoding policy in the logic of face attributes. I don't think we do that, users can still customize faces as they see fit. Jan D.