From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: About the :distant-foreground face attribute Date: Wed, 08 Jan 2014 19:43:57 +0200 Message-ID: <83bnzmfjxe.fsf@gnu.org> References: <87bnzo9cja.fsf@gnu.org> <59B7E7FC-48D0-4737-B1BB-FFAC5BA9E07A@swipnet.se> <874n5f3162.fsf@gnu.org> <83fvozf86g.fsf@gnu.org> <87r48javwe.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1389203066 18603 80.91.229.3 (8 Jan 2014 17:44:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2014 17:44:26 +0000 (UTC) Cc: jan.h.d@swipnet.se, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 08 18:44:32 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 1W0xB5-0001mN-2R for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 18:44:27 +0100 Original-Received: from localhost ([::1]:48128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0xB4-0007pr-O7 for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 12:44:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0xAw-0007hh-ES for emacs-devel@gnu.org; Wed, 08 Jan 2014 12:44:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0xAr-0004vn-Ar for emacs-devel@gnu.org; Wed, 08 Jan 2014 12:44:18 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:59508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0xAl-0004uo-Kx; Wed, 08 Jan 2014 12:44:07 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MZ300100FW98A00@a-mtaout21.012.net.il>; Wed, 08 Jan 2014 19:44:06 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MZ3001ZUFXE1UA0@a-mtaout21.012.net.il>; Wed, 08 Jan 2014 19:44:02 +0200 (IST) In-reply-to: <87r48javwe.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:167760 Archived-At: > From: Chong Yidong > Cc: jan.h.d@swipnet.se, emacs-devel@gnu.org > Date: Wed, 08 Jan 2014 13:24:17 +0800 > > Eli Zaretskii writes: > > >> The feature does not fit well with the design of the rest of the > >> face-handling code. We already have a mechanism for checking to see > >> when to use a particular face: the DISPLAY element in a face spec. The > >> :distant-foreground face attribute, by its very existence, is redundant > >> with what the DISPLAY element was meant to do. This adds extra > >> complexity to the design, for no good reason. > > > > I don't understand this criticism. How is this attribute different > > from min-colors? > > The min-colors feature doesn't involve adding an extra face attribute. This is an implementation detail, while your criticism above seems to be about the design. > The analogy would be if there was a :low-color-foreground face attribute > which would override :foreground on low-color displays. That would be > ugly, as I hope you agree. I'm not sure I see the ugliness, please elaborate. > Change the feature so it applies to all faces, but in a configurable > way. Introduce a new Lisp variable, `face-minimum-contrast', which > specifies the minimum allowed contrast between the background and > foreground of any face (or nil, which means to disable the feature). If > the contrast of a face is lower than specified, the foreground color is > adjusted (say, by changing its V component) to conform to the minimum > contrast. I don't think it will be a good idea to have a single global setting, because this would preclude a Lisp program from defining a face that will always use the specified foreground, no matter what. E.g., I could imagine an application that would like to make the text invisible by specifying the same fore- and background colors. While probably rare, such use cases are entirely legitimate, I think. So I think we need this to be specified on the level of individual faces.