Mercurial > hg > xemacs-beta
diff lisp/window-xemacs.el @ 4674:e95ddfd6a409
In `set-window-configuration', don't restore frame size unconditionally.
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Mon, 03 Aug 2009 10:30:47 +0200 |
parents | 11d71be1c232 |
children | f00192e1cd49 308d34e9f07d |
line wrap: on
line diff
--- a/lisp/window-xemacs.el Wed Jul 29 10:23:19 2009 +0200 +++ b/lisp/window-xemacs.el Mon Aug 03 10:30:47 2009 +0200 @@ -310,17 +310,20 @@ (setq ,mapping (set-window-configuration/mapping ,window-config))) ,mapping))) -(defun set-window-configuration (configuration) - "Set the configuration of windows and buffers as specified by CONFIGURATION. -CONFIGURATION must be a value previously returned -by `current-window-configuration'." - (set-window-configuration/mapping configuration) - nil) ; make sure nobody relies on mapping return value - -(defun set-window-configuration/mapping (configuration) +(defun set-window-configuration (configuration &optional set-frame-size-p) "Set the configuration of windows and buffers as specified by CONFIGURATION. CONFIGURATION must be a value previously returned by `current-window-configuration'. +If SET-FRAME-SIZE-P is true, the frame size is also restored. +" + (set-window-configuration/mapping configuration set-frame-size-p) + nil) ; make sure nobody relies on mapping return value + +(defun set-window-configuration/mapping (configuration &optional set-frame-size-p) + "Set the configuration of windows and buffers as specified by CONFIGURATION. +CONFIGURATION must be a value previously returned +by `current-window-configuration'. +If SET-FRAME-SIZE-P is true, the frame size is also restored. Return alist mapping old windows to new windows. This alist maps the originally captured windows to the windows that correspond to them in the restored configuration. It does not include entries for @@ -329,10 +332,11 @@ (if (and (frame-live-p frame) (not (window-configuration-equal configuration (current-window-configuration)))) - (really-set-window-configuration frame configuration)))) + (really-set-window-configuration frame configuration set-frame-size-p)))) -(defun really-set-window-configuration (frame configuration) +(defun really-set-window-configuration (frame configuration set-frame-size-p) "Set the window configuration CONFIGURATION on live frame FRAME. +If SET-FRAME-SIZE-P is true, the frame size is also restored. Return alist mapping old windows to new windows." ;; avoid potential temporary problems (setq window-min-width 0) @@ -340,7 +344,8 @@ (setq minibuffer-scroll-window nil) (frame-reduce-to-one-window frame) - (set-window-configuration-frame-size configuration) + (if set-frame-size-p + (set-window-configuration-frame-size configuration)) ;; avoid setting these if they're already up-to-date ;; This also avoids potential inaccuracies in these settings --Mike @@ -379,6 +384,9 @@ (if (buffer-live-p buffer) (set-buffer buffer) (set-buffer (car (buffer-list))))) + ; this resets the window configuration so that the frame is filled + (if (not set-frame-size-p) + (set-frame-pixel-size frame (frame-pixel-width frame) (frame-pixel-height frame))) (car mapping))) (defun set-window-configuration-frame-size (configuration)