Commit 0216b738 authored by Chong Yidong's avatar Chong Yidong

Fix background-color setting in initial frame (Bug#7373).

* lisp/frame.el (frame-notice-user-settings): Don't clobber other
user-set parameters when calling face-set-after-frame-default in
response to background-color parameter (Bug#7373).
parent 4a9f985c
2010-11-13 Chong Yidong <cyd@stupidchicken.com>
* frame.el (frame-notice-user-settings): Don't clobber other
user-set parameters when calling face-set-after-frame-default in
response to background-color parameter (Bug#7373).
2010-11-13 Eli Zaretskii <eliz@gnu.org>
* international/characters.el (glyphless-char-display-control):
......
......@@ -296,22 +296,19 @@ there (in decreasing order of priority)."
(null frame-initial-frame))
;; This case happens when we don't have a window system, and
;; also for MS-DOS frames.
(let ((parms (frame-parameters frame-initial-frame)))
(let ((parms (frame-parameters)))
;; Don't change the frame names.
(setq parms (delq (assq 'name parms) parms))
;; Can't modify the minibuffer parameter, so don't try.
(setq parms (delq (assq 'minibuffer parms) parms))
(modify-frame-parameters nil
(if (null initial-window-system)
(append initial-frame-alist
window-system-frame-alist
default-frame-alist
parms
nil)
;; initial-frame-alist and
;; default-frame-alist were already
;; applied in pc-win.el.
parms))
(modify-frame-parameters
nil
(if initial-window-system
parms
;; initial-frame-alist and default-frame-alist were already
;; applied in pc-win.el.
(append initial-frame-alist window-system-frame-alist
default-frame-alist parms nil)))
(if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el
(let ((newparms (frame-parameters))
(frame (selected-frame)))
......@@ -512,25 +509,28 @@ there (in decreasing order of priority)."
;; it is undesirable to specify the parm again
;; once the user has seen the frame and been able to alter it
;; manually.
(while tail
(let (newval oldval)
(setq oldval (assq (car (car tail))
frame-initial-frame-alist))
(setq newval (cdr (assq (car (car tail)) allparms)))
(let (newval oldval)
(dolist (entry tail)
(setq oldval (assq (car entry) frame-initial-frame-alist))
(setq newval (cdr (assq (car entry) allparms)))
(or (and oldval (eq (cdr oldval) newval))
(setq newparms
(cons (cons (car (car tail)) newval) newparms))))
(setq tail (cdr tail)))
(cons (cons (car entry) newval) newparms)))))
(setq newparms (nreverse newparms))
(modify-frame-parameters frame-initial-frame
newparms)
;; If we changed the background color,
;; we need to update the background-mode parameter
;; and maybe some faces too.
(when (assq 'background-color newparms)
(unless (assq 'background-mode newparms)
(frame-set-background-mode frame-initial-frame))
(face-set-after-frame-default frame-initial-frame)))))
(let ((new-bg (assq 'background-color newparms)))
;; If the `background-color' parameter is changed, apply
;; it first, then make sure that the `background-mode'
;; parameter and other faces are updated, before applying
;; the other parameters.
(when new-bg
(modify-frame-parameters frame-initial-frame
(list new-bg))
(unless (assq 'background-mode newparms)
(frame-set-background-mode frame-initial-frame))
(face-set-after-frame-default frame-initial-frame)
(setq newparms (delq new-bg newparms)))
(modify-frame-parameters frame-initial-frame newparms)))))
;; Restore the original buffer.
(set-buffer old-buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment