Mercurial > emacs
comparison lisp/frame.el @ 7343:81f9ad98c323
(frame-notice-user-settings): When replacing the first
X frame, use the same geometry parms that were used to make it.
(frame-remove-geometry-params):
Treat user-size and user-position as geometry parms.
Store all those parms into frame-initial-geometry-arguments.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 05 May 1994 22:37:47 +0000 |
parents | 1f3536445289 |
children | 17a251bf595b |
comparison
equal
deleted
inserted
replaced
7342:4cf4669565af | 7343:81f9ad98c323 |
---|---|
109 ;;; If we create the initial frame, this is it. | 109 ;;; If we create the initial frame, this is it. |
110 (defvar frame-initial-frame nil) | 110 (defvar frame-initial-frame nil) |
111 | 111 |
112 ;; Record the parameters used in frame-initialize to make the initial frame. | 112 ;; Record the parameters used in frame-initialize to make the initial frame. |
113 (defvar frame-initial-frame-alist) | 113 (defvar frame-initial-frame-alist) |
114 | |
115 (defvar frame-initial-geometry-arguments nil) | |
114 | 116 |
115 ;;; startup.el calls this function before loading the user's init | 117 ;;; startup.el calls this function before loading the user's init |
116 ;;; file - if there is no frame with a minibuffer open now, create | 118 ;;; file - if there is no frame with a minibuffer open now, create |
117 ;;; one to display messages while loading the init file. | 119 ;;; one to display messages while loading the init file. |
118 (defun frame-initialize () | 120 (defun frame-initialize () |
185 default-frame-alist | 187 default-frame-alist |
186 (frame-parameters frame-initial-frame) | 188 (frame-parameters frame-initial-frame) |
187 nil)) | 189 nil)) |
188 ;; Get rid of `reverse', because that was handled | 190 ;; Get rid of `reverse', because that was handled |
189 ;; when we first made the frame. | 191 ;; when we first made the frame. |
190 (new (make-frame (cons '(reverse . nil) | 192 (new (make-frame |
191 (delq (assq 'reverse parms) parms))))) | 193 ;; Use the geometry args that created the existing |
194 ;; frame, rather than the parms we get for it.q | |
195 (append frame-initial-geometry-arguments | |
196 (let (frame-initial-geometry-arguments) | |
197 (frame-remove-geometry-params | |
198 (cons '(reverse . nil) | |
199 (delq (assq 'reverse parms) | |
200 parms)))))))) | |
192 ;; The initial frame, which we are about to delete, may be | 201 ;; The initial frame, which we are about to delete, may be |
193 ;; the only frame with a minibuffer. If it is, create a | 202 ;; the only frame with a minibuffer. If it is, create a |
194 ;; new one. | 203 ;; new one. |
195 (or (delq frame-initial-frame (minibuffer-frame-list)) | 204 (or (delq frame-initial-frame (minibuffer-frame-list)) |
196 (make-frame (append minibuffer-frame-alist | 205 (make-frame (append minibuffer-frame-alist |
350 (eq frame (window-frame (minibuffer-window frame))))))) | 359 (eq frame (window-frame (minibuffer-window frame))))))) |
351 | 360 |
352 (defun frame-remove-geometry-params (param-list) | 361 (defun frame-remove-geometry-params (param-list) |
353 "Return the parameter list PARAM-LIST, but with geometry specs removed. | 362 "Return the parameter list PARAM-LIST, but with geometry specs removed. |
354 This deletes all bindings in PARAM-LIST for `top', `left', `width', | 363 This deletes all bindings in PARAM-LIST for `top', `left', `width', |
355 and `height' parameters. | 364 `height', `user-size' and `user-position' parameters. |
356 Emacs uses this to avoid overriding explicit moves and resizings from | 365 Emacs uses this to avoid overriding explicit moves and resizings from |
357 the user during startup." | 366 the user during startup." |
358 (setq param-list (cons nil param-list)) | 367 (setq param-list (cons nil param-list)) |
359 (let ((tail param-list)) | 368 (let ((tail param-list)) |
360 (while (consp (cdr tail)) | 369 (while (consp (cdr tail)) |
361 (if (and (consp (car (cdr tail))) | 370 (if (and (consp (car (cdr tail))) |
362 (memq (car (car (cdr tail))) '(height width top left))) | 371 (memq (car (car (cdr tail))) |
363 (setcdr tail (cdr (cdr tail))) | 372 '(height width top left user-position user-size))) |
373 (progn | |
374 (setq frame-initial-geometry-arguments | |
375 (cons (car (cdr tail)) frame-initial-geometry-arguments)) | |
376 (setcdr tail (cdr (cdr tail)))) | |
364 (setq tail (cdr tail))))) | 377 (setq tail (cdr tail))))) |
365 (cdr param-list)) | 378 (cdr param-list)) |
366 | 379 |
367 | 380 |
368 (defun other-frame (arg) | 381 (defun other-frame (arg) |