all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* OSX "new frame" mangles default face
@ 2007-08-09  6:46 Randal L. Schwartz
  2007-08-09  7:12 ` Randal L. Schwartz
  2007-08-09 23:11 ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Randal L. Schwartz @ 2007-08-09  6:46 UTC (permalink / raw)
  To: emacs-devel


This behavior changed recently (within the past few weeks).  I'm
sorry that I can't narrow it more closely than that.

I have the following in my .emacs:

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "apple-dejavu sans mono"))))
 '(fixed-pitch ((t (:family "apple-dejavu sans mono"))))
 '(variable-pitch ((t (:family "apple-dejavu sans")))))

Emacs properly fires up with my selected font.  Also, emacs properly
breaks to a new frame with that font when I use "^X 5 B dummy RET".
Or at least, it *used* to do that.  When I just tried that a moment
ago (for the first time in a few weeks), I got a totally different
font in the new frame.  When I call M-x customize-face RET default RET
in that window, it shows me "apple-monaco"!  Why did it lose my face?
And why did this start only recently?  Ugh!  I hate apple-monaco. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  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 23:11 ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Randal L. Schwartz @ 2007-08-09  7:12 UTC (permalink / raw)
  To: emacs-devel

>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:

Randal> This behavior changed recently (within the past few weeks).  I'm
Randal> sorry that I can't narrow it more closely than that.

Randal> I have the following in my .emacs:

Randal> (custom-set-faces
Randal>   ;; custom-set-faces was added by Custom.
Randal>   ;; If you edit it by hand, you could mess it up, so be careful.
Randal>   ;; Your init file should contain only one such instance.
Randal>   ;; If there is more than one, they won't work right.
Randal>  '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "apple-dejavu sans mono"))))
Randal>  '(fixed-pitch ((t (:family "apple-dejavu sans mono"))))
Randal>  '(variable-pitch ((t (:family "apple-dejavu sans")))))

Randal> Emacs properly fires up with my selected font.  Also, emacs properly
Randal> breaks to a new frame with that font when I use "^X 5 B dummy RET".
Randal> Or at least, it *used* to do that.  When I just tried that a moment
Randal> ago (for the first time in a few weeks), I got a totally different
Randal> font in the new frame.  When I call M-x customize-face RET default RET
Randal> in that window, it shows me "apple-monaco"!  Why did it lose my face?
Randal> And why did this start only recently?  Ugh!  I hate apple-monaco. :)

As a data point, I just checked out EMACS_22_1 and recompiled,
and the problem is *not* in there.  I get the original behavior that
I've come to expect... new frame keeps same default face.

So it's something introduced between 22.1 and CVS HEAD.  Hope that helps.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  2007-08-09  7:12 ` Randal L. Schwartz
@ 2007-08-09  7:52   ` YAMAMOTO Mitsuharu
  2007-08-09  9:48     ` Daiki Ueno
  0 siblings, 1 reply; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2007-08-09  7:52 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: emacs-devel

>>>>> On Thu, 09 Aug 2007 00:12:35 -0700, merlyn@stonehenge.com (Randal L. Schwartz) said:

> As a data point, I just checked out EMACS_22_1 and recompiled, and
> the problem is *not* in there.  I get the original behavior that
> I've come to expect... new frame keeps same default face.

> So it's something introduced between 22.1 and CVS HEAD.  Hope that
> helps.

I could get the 22.1 behavior by undoing the following change:

2007-08-03  Daiki Ueno  <ueno@unixuser.org>

	* faces.el (face-normalize-spec): New function.
	(frame-set-background-mode): Normalize face-spec before calling
	face-spec-match-p.

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)))

For example,

  % emacs -Q -D

  (face-default-spec 'italic)
  => ((((supports :slant italic)) :slant italic) (((supports :underline t)) :underline t) (t :slant italic))

  (face-normalize-spec (face-default-spec 'italic))
  => nil

while

  (face-normalize-spec (face-spec-choose (face-default-spec 'italic)))
  => (:slant italic)

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  2007-08-09  7:52   ` YAMAMOTO Mitsuharu
@ 2007-08-09  9:48     ` Daiki Ueno
  2007-08-15 23:15       ` Randal L. Schwartz
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Daiki Ueno @ 2007-08-09  9:48 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: emacs-devel, Randal L. Schwartz

>>>>> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  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 23:11 ` Richard Stallman
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2007-08-09 23:11 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: emacs-devel

Can someone please try this on GNU/Linux?


From: merlyn@stonehenge.com (Randal L. Schwartz)
Date: Wed, 08 Aug 2007 23:46:30 -0700

This behavior changed recently (within the past few weeks).  I'm
sorry that I can't narrow it more closely than that.

I have the following in my .emacs:

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "apple-dejavu sans mono"))))
 '(fixed-pitch ((t (:family "apple-dejavu sans mono"))))
 '(variable-pitch ((t (:family "apple-dejavu sans")))))

Emacs properly fires up with my selected font.  Also, emacs properly
breaks to a new frame with that font when I use "^X 5 B dummy RET".
Or at least, it *used* to do that.  When I just tried that a moment
ago (for the first time in a few weeks), I got a totally different
font in the new frame.  When I call M-x customize-face RET default RET
in that window, it shows me "apple-monaco"!  Why did it lose my face?
And why did this start only recently?  Ugh!  I hate apple-monaco. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  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
  2 siblings, 0 replies; 9+ messages in thread
From: Randal L. Schwartz @ 2007-08-15 23:15 UTC (permalink / raw)
  To: emacs-devel; +Cc: Daiki Ueno

>>>>> "DU" == Daiki Ueno <ueno@unixuser.org> writes:

DU> Yes, you are right.  I must have been half asleep when I posted the
DU> patch.  Here is the fix, but I'm not sure which is better to make
DU> face-normalize-spec accept an alist in ((DISPLAY ATTS) ...) form, or to
DU> call (the original) face-normalize-spec after face-spec-choose though.

I don't know if this patch got incorporated.  I tried compiling HEAD
yesterday (or day before) and got the broken behavior.  Is this going
in soon?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  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
  2 siblings, 0 replies; 9+ messages in thread
From: Randal L. Schwartz @ 2007-08-24 15:13 UTC (permalink / raw)
  To: emacs-devel; +Cc: Daiki Ueno

>>>>> "DU" == Daiki Ueno <ueno@unixuser.org> writes:

DU> Yes, you are right.  I must have been half asleep when I posted the
DU> patch.  Here is the fix, but I'm not sure which is better to make
DU> face-normalize-spec accept an alist in ((DISPLAY ATTS) ...) form, or to
DU> call (the original) face-normalize-spec after face-spec-choose though.

Is this patch *ever* going to go in?  I'm stuck on 22.1 release until
the CVS HEAD is usable again.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  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
  2007-11-02  8:45         ` YAMAMOTO Mitsuharu
  2 siblings, 1 reply; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2007-10-09  2:10 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: Randal L. Schwartz, emacs-devel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: OSX "new frame" mangles default face
  2007-10-09  2:10       ` YAMAMOTO Mitsuharu
@ 2007-11-02  8:45         ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2007-11-02  8:45 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: emacs-devel, Randal L. Schwartz

>>>>> On Tue, 09 Oct 2007 11:10:08 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

> 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.

As 22.2 pretest is approaching, I'll back it out if there's no comment
in another week.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-02  8:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-11-02  8:45         ` YAMAMOTO Mitsuharu
2007-08-09 23:11 ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.