unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Daiki Ueno <ueno@unixuser.org>
Cc: "Randal L. Schwartz" <merlyn@stonehenge.com>, emacs-devel@gnu.org
Subject: Re: OSX "new frame" mangles default face
Date: Tue, 09 Oct 2007 11:10:08 +0900	[thread overview]
Message-ID: <wl7ilxkphb.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <320887ac-1a39-4dde-9c41-8bbf483656e8@well-done.deisui.org>

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  <ueno@unixuser.org> [in trunk]
2007-07-31  Daiki Ueno  <ueno@unixuser.org> [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 <ueno@unixuser.org> said:

>>>>> In <wllkcluouq.wl%mituharu@math.s.chiba-u.ac.jp> 
>>>>>> YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 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)))
  
>   \f
> --- 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)))
  
>   \f

> Regards,
> -- 
> Daiki Ueno


> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2007-10-09  2:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09  6:46 OSX "new frame" mangles default face Randal L. Schwartz
2007-08-09  7:12 ` Randal L. Schwartz
2007-08-09  7:52   ` YAMAMOTO Mitsuharu
2007-08-09  9:48     ` Daiki Ueno
2007-08-15 23:15       ` Randal L. Schwartz
2007-08-24 15:13       ` Randal L. Schwartz
2007-10-09  2:10       ` YAMAMOTO Mitsuharu [this message]
2007-11-02  8:45         ` YAMAMOTO Mitsuharu
2007-08-09 23:11 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wl7ilxkphb.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=emacs-devel@gnu.org \
    --cc=merlyn@stonehenge.com \
    --cc=ueno@unixuser.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).