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: Problems with setting face attributes for specific frames Date: Sun, 30 Sep 2007 16:54:01 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1191196568 30652 80.91.229.12 (30 Sep 2007 23:56:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2007 23:56:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: , "Johannes Weiner" , , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 01 01:56:04 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ic8dn-0005EN-KB for ged-emacs-devel@m.gmane.org; Mon, 01 Oct 2007 01:56:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ic8dj-0003wO-U2 for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2007 19:55:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ic8dg-0003w8-7x for emacs-devel@gnu.org; Sun, 30 Sep 2007 19:55:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ic8de-0003vv-8K for emacs-devel@gnu.org; Sun, 30 Sep 2007 19:55:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ic8de-0003vs-2a for emacs-devel@gnu.org; Sun, 30 Sep 2007 19:55:54 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ic8dV-0005ol-OG; Sun, 30 Sep 2007 19:55:46 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l8UNtaRp012604; Sun, 30 Sep 2007 18:55:36 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id l8UNLV80005056; Sun, 30 Sep 2007 17:55:35 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-133.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 3255987541191196417; Sun, 30 Sep 2007 16:53:37 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 In-Reply-To: X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80072 Archived-At: > In this message I propose a change in how faces work, in response > to the analysis of this bug. > > The logic in `frame-set-background-mode' is correct for the case > of customizing `frame-background-mode'. It distinguishes the > faces that match their defface specs from those for which attributes > were overridden (perhaps by calling `set-face-attribute'). > It recalculates the former in the proper new way from the defface, > and it leaves the latter alone. > > However, the logic is wrong for this case, where > `frame-set-background-mode' is called from `set-background-color'. If > my analysis is correct, by the time `frame-set-background-mode' is > called, the new background color has already been installed in the > frame, but most faces still use the old one, so they do not match > their specs any more. > > I think the code that handles faces needs to be cleaned up to keep > user-specified single-frame face attributes separately from the > actual face attributes deduced from the combination of all sources. > That is the only way to deduce new actual face attributes correctly > after changes in some of the parameters that the deduction is done from. > > Or perhaps we should get rid of using `set-face-attribute' to specify > face attributes on a frame. > > Not many packages call `set-face-attribute'. There are just > two in Emacs that use it with a frame: ediff-wind.el > and mac-win.el. pc-win.el calls it via `set-face-foreground' > and `set-face-background'. The obsolete hilit19 package > calls `set-face-font', but we could delete that. I don't understand all of what you're proposing or what the problem is that you're fixing. I think you're proposing removing the FRAME arg from `set-face-attribute' (perhaps among other changes). Is that correct? I do use `set-face-attribute' in some of my code, but always with a nil FRAME arg, so that would be OK by me. I assume that we would still have `modify-face', in any case, right?