From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: OSX "new frame" mangles default face Date: Tue, 09 Oct 2007 11:10:08 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <86ir7pp5mh.fsf@blue.stonehenge.com> <86abt1p4f0.fsf@blue.stonehenge.com> <320887ac-1a39-4dde-9c41-8bbf483656e8@well-done.deisui.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1191895841 19237 80.91.229.12 (9 Oct 2007 02:10:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Oct 2007 02:10:41 +0000 (UTC) Cc: "Randal L. Schwartz" , emacs-devel@gnu.org To: Daiki Ueno Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 09 04:10:38 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 1If4YE-00074i-QI for ged-emacs-devel@m.gmane.org; Tue, 09 Oct 2007 04:10:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1If4Y9-0002x0-0h for ged-emacs-devel@m.gmane.org; Mon, 08 Oct 2007 22:10:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1If4Y5-0002u0-4M for emacs-devel@gnu.org; Mon, 08 Oct 2007 22:10:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1If4Y3-0002rS-BI for emacs-devel@gnu.org; Mon, 08 Oct 2007 22:10:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1If4Y3-0002rH-7D for emacs-devel@gnu.org; Mon, 08 Oct 2007 22:10:15 -0400 Original-Received: from ntp.math.s.chiba-u.ac.jp ([133.82.132.2] helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1If4Y2-0002J7-AQ for emacs-devel@gnu.org; Mon, 08 Oct 2007 22:10:14 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id A74B12C40; Tue, 9 Oct 2007 11:10:08 +0900 (JST) In-Reply-To: <320887ac-1a39-4dde-9c41-8bbf483656e8@well-done.deisui.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/23.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-Detected-Kernel: NetBSD 3.0 (DF) 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:80450 Archived-At: Could someone familiar with faces make a comment on Daiki Ueno's second patch below? If there's no comments, I'd suggest backing out his first patch, 2007-08-03 Daiki Ueno [in trunk] 2007-07-31 Daiki Ueno [in EMACS_22_BASE] * faces.el (face-normalize-spec): New function. (frame-set-background-mode): Normalize face-spec before calling face-spec-match-p. which is apparently wrong, at least for EMACS_22_BASE to avoid regression. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp >>>>> On Thu, 09 Aug 2007 18:48:27 +0900, Daiki Ueno said: >>>>> In >>>>>> YAMAMOTO Mitsuharu wrote: >> http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg01682.html >> Actually, the following usage of `face-normalize-spec' in >> `frame-set-background-mode' looks strange. >> (dolist (face (face-list)) >> (when (not (face-spec-match-p face >> (face-normalize-spec >> (face-user-default-spec face)) >> (selected-frame))) >> (push face locally-modified-faces))) > Yes, you are right. I must have been half asleep when I posted the > patch. Here is the fix, but I'm not sure which is better to make > face-normalize-spec accept an alist in ((DISPLAY ATTS) ...) form, or to > call (the original) face-normalize-spec after face-spec-choose though. > Index: lisp/faces.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/faces.el,v > retrieving revision 1.373 > diff -c -r1.373 faces.el > *** lisp/faces.el 3 Aug 2007 05:49:56 -0000 1.373 > --- lisp/faces.el 9 Aug 2007 09:38:07 -0000 > *************** > *** 1510,1531 **** > "Return a normalized face-spec of SPEC." > (let (normalized-spec) > (while spec > ! (let ((attribute (car spec)) > ! (value (car (cdr spec)))) > ! ;; Support some old-style attribute names and values. > ! (case attribute > ! (:bold (setq attribute :weight value (if value 'bold 'normal))) > ! (:italic (setq attribute :slant value (if value 'italic 'normal))) > ! ((:foreground :background) > ! ;; Compatibility with 20.x. Some bogus face specs seem to > ! ;; exist containing things like `:foreground nil'. > ! (if (null value) (setq value 'unspecified))) > ! (t (unless (assq attribute face-x-resources) > ! (setq attribute nil)))) > ! (when attribute > ! (push attribute normalized-spec) > ! (push value normalized-spec))) > ! (setq spec (cdr (cdr spec)))) > (nreverse normalized-spec))) > > --- 1510,1537 ---- > "Return a normalized face-spec of SPEC." > (let (normalized-spec) > (while spec > ! (let ((display (car (car spec))) > ! (atts (cdr (car spec))) > ! normalized-atts) > ! (while atts > ! (let ((attribute (car atts)) > ! (value (car (cdr atts)))) > ! ;; Support some old-style attribute names and values. > ! (case attribute > ! (:bold (setq attribute :weight value (if value 'bold 'normal))) > ! (:italic (setq attribute :slant value (if value 'italic 'normal))) > ! ((:foreground :background) > ! ;; Compatibility with 20.x. Some bogus face specs seem to > ! ;; exist containing things like `:foreground nil'. > ! (if (null value) (setq value 'unspecified))) > ! (t (unless (assq attribute face-x-resources) > ! (setq attribute nil)))) > ! (when attribute > ! (push attribute normalized-atts) > ! (push value normalized-atts))) > ! (setq atts (cdr (cdr atts)))) > ! (push (cons display (nreverse normalized-atts)) normalized-spec) > ! (setq spec (cdr spec)))) > (nreverse normalized-spec))) > > Regards, > -- > Daiki Ueno > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel