;;; If we create the initial frame, this is it.
(defvar frame-initial-frame nil)
+;; Record the parameters used in frame-initialize to make the initial frame.
+(defvar frame-initial-frame-alist)
+
;;; startup.el calls this function before loading the user's init
;;; file - if there is no frame with a minibuffer open now, create
;;; one to display messages while loading the init file.
;; minibuffer spec.
(or (delq terminal-frame (minibuffer-frame-list))
(progn
+ (setq frame-initial-frame-alist
+ (append initial-frame-alist default-frame-alist))
(setq default-minibuffer-frame
(setq frame-initial-frame
(new-frame initial-frame-alist)))
;; Otherwise, we don't need all that rigamarole; just apply
;; the new parameters.
- (modify-frame-parameters frame-initial-frame
- (append initial-frame-alist
- default-frame-alist))))
+ (let (newparms allparms tail)
+ (setq allparms (append initial-frame-alist
+ default-frame-alist))
+ (setq tail allparms)
+ ;; Find just the parms that have changed since we first
+ ;; made this frame. Those are the ones actually set by
+ ;; the init file. For those parms whose values we already knew
+ ;; (such as those spec'd by command line options)
+ ;; 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 (cdr (assq (car (car tail))
+ frame-initial-frame-alist)))
+ (setq newval (cdr (assq (car (car tail)) allparms)))
+ (or (eq oldval newval)
+ (setq newparms
+ (cons (cons (car (car tail)) newval) newparms))))
+ (setq tail (cdr tail)))
+ (modify-frame-parameters frame-initial-frame
+ (nreverse newparms)))))
;; Restore the original buffer.
(set-buffer old-buffer)