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: Faces applies to new frames Date: Sat, 28 Jun 2008 19:42:06 -0400 Message-ID: <871w2hcek1.fsf@stupidchicken.com> References: <87k5gbx12n.fsf@stupidchicken.com> <87iqvty2e7.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1214696541 2044 80.91.229.12 (28 Jun 2008 23:42:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Jun 2008 23:42:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 29 01:43:06 2008 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 1KCk4O-0004nn-Rj for ged-emacs-devel@m.gmane.org; Sun, 29 Jun 2008 01:43:05 +0200 Original-Received: from localhost ([127.0.0.1]:45844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KCk3Y-0004qw-U9 for ged-emacs-devel@m.gmane.org; Sat, 28 Jun 2008 19:42:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KCk3V-0004qh-3g for emacs-devel@gnu.org; Sat, 28 Jun 2008 19:42:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KCk3T-0004qV-Fn for emacs-devel@gnu.org; Sat, 28 Jun 2008 19:42:08 -0400 Original-Received: from [199.232.76.173] (port=46696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KCk3T-0004qS-DM for emacs-devel@gnu.org; Sat, 28 Jun 2008 19:42:07 -0400 Original-Received: from c-24-63-201-57.hsd1.ma.comcast.net ([24.63.201.57]:13033 helo=furry) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KCk3T-0006HU-6s for emacs-devel@gnu.org; Sat, 28 Jun 2008 19:42:07 -0400 Original-Received: by furry (Postfix, from userid 1000) id C8E36C054; Sat, 28 Jun 2008 19:42:06 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Sat, 28 Jun 2008 16:17:07 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:100109 Archived-At: Stefan Monnier writes: >> The attached patch does this. It also removes the `font-parameter' >> frame parameter, which is used to override the default face (a similar >> patch will be needed for w32fns.c). I think this is bogus. > > I'm not sure I understand what your patch does (as mentioned already, > I think the current setup's interactions are too numerous and I don't > know them all, so I can't predict the effect of any particular change). When set-face-attribute changes the default for new frames, what it does is to change the face vector for the `default' face entry in face-new-frame-defaults. When you create a new frame, the frame parameter for that frame is whatever was specified using X resources or the command line. If you've changed face-new-frame-defaults in the meantime, you get a mismatch between the two fonts. What then happens is that in the last step of face-new-frame-defaults, the frame parameter inadvertently gets applied to the default face, wiping out the effects of face-new-frame-defaults. >> + ;; The face specs may specify a different default font. Save this >> + ;; in the `font' frame parameter. >> + (setq default-font (face-font 'default)) >> + (when default-font >> + (set-frame-parameter frame 'font default-font)) > > But doesn't that mean that (make-frame '((font . "foo-bar"))) will > disregard the explicit request for "foo-bar"? True. I think that in this case, x-create-frame-with-faces should take note that it is passed a `font' frame parameter, and tell face-set-after-frame-default to stick to that instead of imposing whatever the `default' face says.