comparison lisp/frame.el @ 4305:a39dcf68a29c

(frame-notice-user-settings): Don't reapply a parm whose value is ot changed (as far as we know) since frame-initialize.
author Richard M. Stallman <rms@gnu.org>
date Tue, 27 Jul 1993 08:34:34 +0000
parents 6e7afc0a7fbc
children ea004f01b2d8
comparison
equal deleted inserted replaced
4304:b5014da888a8 4305:a39dcf68a29c
79 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings) 79 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings)
80 80
81 ;;; If we create the initial frame, this is it. 81 ;;; If we create the initial frame, this is it.
82 (defvar frame-initial-frame nil) 82 (defvar frame-initial-frame nil)
83 83
84 ;; Record the parameters used in frame-initialize to make the initial frame.
85 (defvar frame-initial-frame-alist)
86
84 ;;; startup.el calls this function before loading the user's init 87 ;;; startup.el calls this function before loading the user's init
85 ;;; file - if there is no frame with a minibuffer open now, create 88 ;;; file - if there is no frame with a minibuffer open now, create
86 ;;; one to display messages while loading the init file. 89 ;;; one to display messages while loading the init file.
87 (defun frame-initialize () 90 (defun frame-initialize ()
88 91
93 ;; frame, then we need to create the opening frame. Make sure 96 ;; frame, then we need to create the opening frame. Make sure
94 ;; it has a minibuffer, but let initial-frame-alist omit the 97 ;; it has a minibuffer, but let initial-frame-alist omit the
95 ;; minibuffer spec. 98 ;; minibuffer spec.
96 (or (delq terminal-frame (minibuffer-frame-list)) 99 (or (delq terminal-frame (minibuffer-frame-list))
97 (progn 100 (progn
101 (setq frame-initial-frame-alist
102 (append initial-frame-alist default-frame-alist))
98 (setq default-minibuffer-frame 103 (setq default-minibuffer-frame
99 (setq frame-initial-frame 104 (setq frame-initial-frame
100 (new-frame initial-frame-alist))) 105 (new-frame initial-frame-alist)))
101 ;; Delete any specifications for window geometry parameters 106 ;; Delete any specifications for window geometry parameters
102 ;; so that we won't reapply them in frame-notice-user-settings. 107 ;; so that we won't reapply them in frame-notice-user-settings.
226 ;; Finally, get rid of the old frame. 231 ;; Finally, get rid of the old frame.
227 (delete-frame frame-initial-frame)) 232 (delete-frame frame-initial-frame))
228 233
229 ;; Otherwise, we don't need all that rigamarole; just apply 234 ;; Otherwise, we don't need all that rigamarole; just apply
230 ;; the new parameters. 235 ;; the new parameters.
231 (modify-frame-parameters frame-initial-frame 236 (let (newparms allparms tail)
232 (append initial-frame-alist 237 (setq allparms (append initial-frame-alist
233 default-frame-alist)))) 238 default-frame-alist))
239 (setq tail allparms)
240 ;; Find just the parms that have changed since we first
241 ;; made this frame. Those are the ones actually set by
242 ;; the init file. For those parms whose values we already knew
243 ;; (such as those spec'd by command line options)
244 ;; it is undesirable to specify the parm again
245 ;; once the user has seen the frame and been able to alter it
246 ;; manually.
247 (while tail
248 (let (newval oldval)
249 (setq oldval (cdr (assq (car (car tail))
250 frame-initial-frame-alist)))
251 (setq newval (cdr (assq (car (car tail)) allparms)))
252 (or (eq oldval newval)
253 (setq newparms
254 (cons (cons (car (car tail)) newval) newparms))))
255 (setq tail (cdr tail)))
256 (modify-frame-parameters frame-initial-frame
257 (nreverse newparms)))))
234 258
235 ;; Restore the original buffer. 259 ;; Restore the original buffer.
236 (set-buffer old-buffer) 260 (set-buffer old-buffer)
237 261
238 ;; Make sure the initial frame can be GC'd if it is ever deleted. 262 ;; Make sure the initial frame can be GC'd if it is ever deleted.