changeset: 4674:e95ddfd6a409
tag: tip
user: Mike Sperber <sperber(a)deinprogramm.de>
date: Mon Aug 03 10:30:47 2009 +0200
files: lisp/ChangeLog lisp/window-xemacs.el
description:
In `set-window-configuration', don't restore frame size unconditionally.
diff -r 11d71be1c232 -r e95ddfd6a409 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Jul 29 10:23:19 2009 +0200
+++ b/lisp/ChangeLog Mon Aug 03 10:30:47 2009 +0200
@@ -9,6 +9,12 @@
* faces.el (set-face-background-pixmap-file):
Remove some extra parentheses revealed by change set 7757334005ae.
+
+2009-08-07 Mike Sperber <mike(a)xemacs.org>
+
+ * window-xemacs.el (set-window-configuration): Add optional
+ `set-frame-size-p' argument that determines whether the frame size
+ should be restored along with the window configuration.
2009-07-29 Mike Sperber <mike(a)xemacs.org>
diff -r 11d71be1c232 -r e95ddfd6a409 lisp/window-xemacs.el
--- 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)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches