From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: 23.0.50; face-problems with multy-tty Date: Thu, 13 Sep 2007 18:05:04 +0200 Message-ID: References: <87ejhcmgp2.fsf@baldur.tsdh.de> <200709062116.l86LGWnO000262@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1189699743 19512 80.91.229.12 (13 Sep 2007 16:09:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2007 16:09:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 18:08:59 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 1IVrEb-0003BP-Jr for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2007 18:08:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVrEb-0007YR-1H for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2007 12:08:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVrBz-0005OF-Tc for emacs-devel@gnu.org; Thu, 13 Sep 2007 12:05:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVrBz-0005Mv-3q for emacs-devel@gnu.org; Thu, 13 Sep 2007 12:05:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVrBy-0005Mk-PX for emacs-devel@gnu.org; Thu, 13 Sep 2007 12:05:22 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IVrBy-0007Dz-4i for emacs-devel@gnu.org; Thu, 13 Sep 2007 12:05:22 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IVrBr-0005OY-Kj for emacs-devel@gnu.org; Thu, 13 Sep 2007 18:05:15 +0200 Original-Received: from gamma02.me.chalmers.se ([129.16.50.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 18:05:15 +0200 Original-Received: from bojohan+news by gamma02.me.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 18:05:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 66 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gamma02.me.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:+Rz8+p4HlrW3XtDnU47myuokG7I= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:78781 Archived-At: Richard Stallman writes: > > face-spec-set is supposed to operate on all frames > > when the FRAME argument is nil. If it doesn't, > > then either its code or its documentation needs to be changed. > > It does "operate on all frames". The problem is that it sets the same > attributes everywhere. > > Is that a bug in face-spec-set? It sounds like one. I can't answer that question. > If it is, the thing to do is fix it, not work around it. > Would you like to look for the right fix? The old code boiled down to calling `set-face-attribute' with a null FRAME argument. This sets a new frame default that is the same for all frames (via face-new-frame-defaults). That is not what we want. The new code calls set-face-attribute locally for each frame. It does not set a default in face-new-frame-defaults. This DTRT unless a default exists in face-new-frame-defaults (or an X resource exists for the face). What is needed is something like what `C-M-x' does on `defface' forms. It removes the global default (in face-new-frame-defaults) before setting the specs. But it doesn't do the right thing if a face has been set via X resources (cf. Re: can't set both mode-line color and default frame font?). (E.g the X resource setting "Emacs.foo.attributeForeground: blue" can't be overridden by on (defface foo '((t :foreground "red")) "") ) I think it comes down to this code in face-set-after-frame-default ;; Initialize faces from face specs and X resources. The ;; condition-case prevents invalid specs from causing frame ;; creation to fail. (dolist (face (delq 'default (face-list))) (condition-case () (progn (face-spec-set face (face-user-default-spec face) frame) ; (1) (if (memq (window-system frame) '(x w32 mac)) (make-face-x-resource-internal face frame)) ; (2) (internal-merge-in-global-face face frame)) ; (3) (error nil))) We want `custom-set-faces' to use frame local specs (1). This requires clearing the global definition (3) (in face-new-frame-defaults, using face-spec-reset-face) But we also need to override the X resource definition for new frames (2), without using the same global definition everywhere (which is what (3) does). What would be a good way to do that? -- Johan Bockgård