GNU bug report logs - #9982
M-x load-theme does not change background color

Previous Next

Package: emacs;

Reported by: Brendan Miller <catphive <at> catphive.net>

Date: Mon, 7 Nov 2011 02:37:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 9982 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: Brendan Miller <catphive <at> catphive.net>, 9982 <at> debbugs.gnu.org
Subject: Re: bug#9982: Theme faces wrongly applied after background changes.
Date: Sun, 29 Jan 2012 22:14:57 +0800
I've committed a patch to trunk that should fix the immediate problem.
The reason this bug triggered under XFCE is that XFCE sends Emacs a
`font-render' config event, and a font-setting-change-default-font bug
caused the default face to be modified even with font-use-system-font
nil.

This patch doesn't address the broader problem, noted in my previous
message: when font-use-system-font is non-nil, the way
font-setting-change-default-font uses custom-push-theme will likely
interefere with the user's own Custom settings and/or Custom themes.

I think that instead of using custom-push-theme,
font-setting-change-default-font should set a `font' frame parameter in
window-system-default-frame-alist.  Something like the following (needs
testing---I don't have Gconf libs installed at the moment).

Jan, WDYT?


=== modified file 'lisp/dynamic-setting.el'
*** lisp/dynamic-setting.el	2012-01-29 13:55:09 +0000
--- lisp/dynamic-setting.el	2012-01-29 14:09:40 +0000
***************
*** 75,86 ****
  
        ;; Set for future frames.
        (when set-font
! 	;; FIXME: this is not going to play well with Custom themes.
! 	(set-face-attribute 'default t :font new-font)
! 	(let ((spec (list (list t (face-attr-construct 'default)))))
! 	  (put 'default 'customized-face spec)
! 	  (custom-push-theme 'theme-face 'default 'user 'set spec)
! 	  (put 'default 'face-modified nil))))))
  
  (defun dynamic-setting-handle-config-changed-event (event)
    "Handle config-changed-event on the display in EVENT.
--- 75,88 ----
  
        ;; Set for future frames.
        (when set-font
! 	(let* ((ws (window-system))
! 	       (alist (assq ws window-system-default-frame-alist)))
! 	  (setq window-system-default-frame-alist
! 		(delq alist window-system-default-frame-alist))
! 	  (setq alist (cdr alist))
! 	  (setq alist (cons (cons 'font new-font)
! 			    (delq 'font alist)))
! 	  (push (cons ws alist) window-system-default-frame-alist))))))
  
  (defun dynamic-setting-handle-config-changed-event (event)
    "Handle config-changed-event on the display in EVENT.




This bug report was last modified 13 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.