From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: About the :distant-foreground face attribute Date: Mon, 13 Jan 2014 04:14:11 +0800 Message-ID: <87fvot2c18.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> <83bnzmfjxe.fsf@gnu.org> <87bnzlyvwb.fsf@gnu.org> <83wqi9cakl.fsf@gnu.org> <87zjn5584t.fsf@gnu.org> <8738kwydon.fsf@engster.org> <871u0dwiyv.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389557662 11197 80.91.229.3 (12 Jan 2014 20:14:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jan 2014 20:14:22 +0000 (UTC) Cc: jan.h.d@swipnet.se, monnier@iro.umontreal.ca, Drew Adams , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 12 21:14:29 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 1W2RQR-0001ts-6m for ged-emacs-devel@m.gmane.org; Sun, 12 Jan 2014 21:14:27 +0100 Original-Received: from localhost ([::1]:39330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2RQQ-0000DE-OD for ged-emacs-devel@m.gmane.org; Sun, 12 Jan 2014 15:14:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2RQI-0008O1-CO for emacs-devel@gnu.org; Sun, 12 Jan 2014 15:14:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2RQC-00009k-AQ for emacs-devel@gnu.org; Sun, 12 Jan 2014 15:14:18 -0500 Original-Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]:36983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2RQC-00009K-0k; Sun, 12 Jan 2014 15:14:12 -0500 Original-Received: by mail-pd0-f181.google.com with SMTP id p10so6530164pdj.26 for ; Sun, 12 Jan 2014 12:14:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=V5VhpCQJ80bg54uVgGZnRDr6Or6Qk9goYzu1ctBv+e4=; b=sn7XWluSn1K5hDbQqRuce7KR9G6S5kbAwm9vRHzzk7CGXqK7GrHdKRxm77zGWLZE1d Y87Df27z/gKj5ZWEhFwZBePmnQsFamVnXgMSlk/7b2MgJJN3IDfjWAyFzdXnOmQV9A65 8l1KeIqZaw/tqLLPK9cszbajpR0xS12N38WmsYQf+6Zvh6mmkmrcLQkM3ZyArI1m6W3j 3NJo5RdGfmscDNBqokOxax4RqhKczyQexR/y/aw08+Zn4Dt6/qKbDUwwMNV2rBgIer5t w29E/VatNeNt8W2eiPAtxvjp1j9oAd1MyERCc8lXOpJU5gvyNifYdtPuaiAiZPcsZEi0 +lUA== X-Received: by 10.66.142.170 with SMTP id rx10mr25873069pab.117.1389557649863; Sun, 12 Jan 2014 12:14:09 -0800 (PST) Original-Received: from tsparkle ([155.69.2.31]) by mx.google.com with ESMTPSA id z10sm42010870pas.6.2014.01.12.12.14.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jan 2014 12:14:08 -0800 (PST) In-Reply-To: <871u0dwiyv.fsf@engster.org> (David Engster's message of "Sun, 12 Jan 2014 12:14:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::235 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:168233 Archived-At: David Engster writes: >> I'm wondering: We already can set different face attributes depending on >> DISPLAY's 'background' property, which can be 'light' or 'dark'. Say the >> user is working with a 'dark' background by default, but we now detect >> that one of the font-lock faces has not enough contrast when highlighted >> by the region: why not simply switch to the face that is defined for >> 'light' background instead? > > Hey look, a tumbleweed! > > I'm assuming everybody's simply stunned by my ingenious proposal? This would not work with customized faces, because Custom sets them with a DISPLAY spec of t by default. Anyway, this proposal would be hard to implement technically, because DISPLAY spec is handled (in Lisp) before the foreground and background attributes are settled on (which takes face inheritance into account and is done in C). Instead, here's a compromise proposal: - Allow :foreground to take the value of (fallback COLOR) or something like that, which would be equivalent to setting :foreground to unspecified and :distant-foreground to COLOR. (We still need a replacement term for "distant foreground". As mentioned before, this term sounds nonsensical.) - In order to avoid incompatibilities, set the :foreground of the `region' face to "*_selection_fg_color". In other words, avoid using the above feature in the `region' face, at least for Emacs 24.4. The rationale is that (i) we can live with having a fixed foreground color for the `region' face, since that was the case in Emacs 24.3 on GTK anyway. And (ii) not using this feature immediately gives third-party packages a "transition period" to adapt to its presence, without immediately failing by encountering it in a standard face. If there are no objections, I can implement this.