]> git.eshelyaron.com Git - emacs.git/commitdiff
(frame-notice-user-settings): Don't reapply a parm
authorRichard M. Stallman <rms@gnu.org>
Tue, 27 Jul 1993 08:34:34 +0000 (08:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 27 Jul 1993 08:34:34 +0000 (08:34 +0000)
whose value is ot changed (as far as we know) since frame-initialize.

lisp/frame.el

index 094e1419181a90849e0dae9b4188eb51e0bb22bb..ac92bdbebc19379d4cc383ee75033cf9fcaed9ad 100644 (file)
@@ -81,6 +81,9 @@ These supersede the values given in `default-frame-alist'.")
 ;;; 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.
@@ -95,6 +98,8 @@ These supersede the values given in `default-frame-alist'.")
        ;; 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)))
@@ -228,9 +233,28 @@ These supersede the values given in `default-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)