[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OSX "new frame" mangles default face
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: OSX "new frame" mangles default face |
Date: |
Tue, 09 Oct 2007 11:10:08 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
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 <address@hidden> [in trunk]
2007-07-31 Daiki Ueno <address@hidden> [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
address@hidden
>>>>> On Thu, 09 Aug 2007 18:48:27 +0900, Daiki Ueno <address@hidden> said:
>>>>> In <address@hidden>
>>>>>> YAMAMOTO Mitsuharu <address@hidden> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: OSX "new frame" mangles default face,
YAMAMOTO Mitsuharu <=