all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Faces applies to new frames
@ 2008-06-26 22:50 Chong Yidong
  2008-06-26 23:08 ` Miles Bader
  2008-06-27  1:28 ` Stefan Monnier
  0 siblings, 2 replies; 39+ messages in thread
From: Chong Yidong @ 2008-06-26 22:50 UTC (permalink / raw)
  To: emacs-devel

I took a look at the problem that several people have reported regarding
default faces not being applied to new frames (e.g. 47 and 120 in the
bug tracker).

AFAICT, the problem is that the default face is controlled by the `font'
frame parameter, but this is not saved to default-frame-alist by
internal-set-lisp-face-attribute.  In comparison, the foreground-color
and background-color frame attributes are saved properly (see
xfaces.c:3415 and 3470).  It doesn't seem practical to fix
internal-set-lisp-face-attribute, but I think we can patch it up in
faces.el.

Could someone check whether this reasoning makes sense, and whether the
attached patch to set-face-attribute makes things work properly?

(BTW, this doesn't affect default faces set under customize under some
circumstances, because that changes the defface spec directly instead of
using set-face-attribute.)


*** trunk/lisp/faces.el.~1.415.~	2008-06-25 18:27:01.000000000 -0400
--- trunk/lisp/faces.el	2008-06-26 18:41:07.000000000 -0400
***************
*** 700,706 ****
  VALUE is the name of a face from which to inherit attributes, or a list
  of face names.  Attributes from inherited faces are merged into the face
  like an underlying face would be, with higher priority than underlying faces."
!   (let ((where (if (null frame) 0 frame)))
      (setq args (purecopy args))
      ;; If we set the new-frame defaults, this face is modified outside Custom.
      (if (memq where '(0 t))
--- 700,716 ----
  VALUE is the name of a face from which to inherit attributes, or a list
  of face names.  Attributes from inherited faces are merged into the face
  like an underlying face would be, with higher priority than underlying faces."
!   (let* ((where (if (null frame) 0 frame))
! 	 (save-modified-font
! 	  (and (eq where 0)
! 	       (eq face 'default)
! 	       (or (plist-member args :family)
! 		   (plist-member args :height)
! 		   (plist-member args :weight)
! 		   (plist-member args :slant)
! 		   (plist-member args :width)
! 		   (plist-member args :bold)
! 		   (plist-member args :italic)))))
      (setq args (purecopy args))
      ;; If we set the new-frame defaults, this face is modified outside Custom.
      (if (memq where '(0 t))
***************
*** 723,729 ****
  	  (internal-set-lisp-face-attribute face (car args)
  					    (purecopy (cadr args))
  					    where)))
!       (setq args (cdr (cdr args))))))
  
  
  (defun make-face-bold (face &optional frame noerror)
--- 733,744 ----
  	  (internal-set-lisp-face-attribute face (car args)
  					    (purecopy (cadr args))
  					    where)))
!       (setq args (cdr (cdr args))))
! 
!     (when save-modified-font
!       (setq default-frame-alist
!       	    (cons (cons 'font (frame-parameter (selected-frame) 'font))
!       		  (assq-delete-all 'font default-frame-alist))))))
  
  
  (defun make-face-bold (face &optional frame noerror)




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

end of thread, other threads:[~2008-06-30 14:43 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-26 22:50 Faces applies to new frames Chong Yidong
2008-06-26 23:08 ` Miles Bader
2008-06-27  1:28 ` Stefan Monnier
2008-06-27  2:43   ` Chong Yidong
2008-06-27  6:18     ` Stefan Monnier
2008-06-27 17:32       ` Chong Yidong
2008-06-27 17:52         ` Stefan Monnier
2008-06-27 17:54           ` Chong Yidong
2008-06-27 10:48   ` Robert J. Chassell
2008-06-27 12:17   ` Robert J. Chassell
2008-06-28 16:01   ` Chong Yidong
2008-06-28 20:17     ` Stefan Monnier
2008-06-28 23:42       ` Chong Yidong
2008-06-29  3:14         ` Stefan Monnier
2008-06-29  3:42           ` Miles Bader
2008-06-29  4:22             ` Stefan Monnier
2008-06-29  4:43               ` Miles Bader
2008-06-29  4:47                 ` Chong Yidong
2008-06-29  8:51                   ` David Kastrup
2008-06-29  5:36                 ` Stefan Monnier
2008-06-29 15:20                   ` Richard M Stallman
2008-06-29 17:08                     ` Chong Yidong
2008-06-30 14:43                       ` Richard M Stallman
2008-06-29 19:42                     ` Stefan Monnier
2008-06-30 14:43                       ` Richard M Stallman
2008-06-29  4:30           ` Chong Yidong
2008-06-29  6:11             ` Stefan Monnier
2008-06-29 15:25               ` Chong Yidong
2008-06-29 18:00                 ` Stefan Monnier
2008-06-29 19:24                   ` Chong Yidong
2008-06-29 20:00                     ` Stefan Monnier
2008-06-29 20:29                       ` Chong Yidong
2008-06-30  0:58                         ` Stefan Monnier
2008-06-30  2:24                           ` Chong Yidong
2008-06-30  4:46                             ` Stefan Monnier
2008-06-30  5:02                               ` Chong Yidong
2008-06-30 14:43                         ` Richard M Stallman
2008-06-29  2:48   ` Chong Yidong
2008-06-29  3:41     ` Stefan Monnier

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.