changeset 3646:b6287dbce5f0

[xemacs-hg @ 2006-10-31 09:16:27 by michaels] 2006-10-28 Nix <nix@esperi.org.uk> * window-xemacs.el (window-configuration-includes-position): New. * window-xemacs.el (window-configuration-equal): Use it: window configurations with distinct positions are equal by default. * window-xemacs.el (really-set-window-configuration): Do not restore window positions unless requested.
author michaels
date Tue, 31 Oct 2006 09:16:29 +0000
parents bb49f3386667
children 510e0d6cee7e
files lisp/ChangeLog lisp/window-xemacs.el
diffstat 2 files changed, 35 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Oct 30 22:51:26 2006 +0000
+++ b/lisp/ChangeLog	Tue Oct 31 09:16:29 2006 +0000
@@ -1,3 +1,11 @@
+2006-10-28  Nix  <nix@esperi.org.uk>
+
+	* window-xemacs.el (window-configuration-includes-position): New.
+	* window-xemacs.el (window-configuration-equal): Use it: window
+	configurations with distinct positions are equal by default.
+	* window-xemacs.el (really-set-window-configuration): Do not
+	restore window positions unless requested.
+
 2006-10-30  Malcolm Purvis  <malcolmp@xemacs.org>
 
 	* startup.el (display-splash-screen):  No longer bring buffer the
--- a/lisp/window-xemacs.el	Mon Oct 30 22:51:26 2006 +0000
+++ b/lisp/window-xemacs.el	Tue Oct 31 09:16:29 2006 +0000
@@ -107,6 +107,15 @@
 
 ;; Window configurations
 
+(defcustom window-configuration-includes-position nil
+  "*Whether restoring window configurations will restore positions too.
+If nil, only the size of windows will be restored.
+
+Note that setting this value to t may have counterintuitive consequences,
+if a window manager employing virtual desktops is in use."
+:type 'boolean
+:group 'windows)
+
 (defstruct saved-window
   currentp minibufferp minibuffer-scrollp
   buffer mark-marker
@@ -128,7 +137,11 @@
 
 (defun window-configuration-equal (conf-1 conf-2)
   "Returns a boolean indicating whether the two given configurations
-are identical."
+are identical.
+
+Window configurations containing windows with different window
+positions are not identical iff `window-configuration-includes-position'
+is t."
   (or (eq conf-1 conf-2)
       (and (eq (window-configuration-frame conf-1)
 	       (window-configuration-frame conf-2))
@@ -136,10 +149,12 @@
 	      (window-configuration-frame-pixel-width conf-2))
 	   (= (window-configuration-frame-pixel-height conf-1)
 	      (window-configuration-frame-pixel-height conf-2))
-	   (equal (window-configuration-frame-top conf-1)
-		  (window-configuration-frame-top conf-2))
-	   (equal (window-configuration-frame-left conf-1)
-		  (window-configuration-frame-left conf-2))
+	   (if window-configuration-includes-position
+               (and (equal (window-configuration-frame-top conf-1)
+                           (window-configuration-frame-top conf-2))
+                    (equal (window-configuration-frame-left conf-1)
+                           (window-configuration-frame-left conf-2)))
+             t)
 	   (eq (window-configuration-current-buffer conf-1)
 	       (window-configuration-current-buffer conf-2))
 	   (saved-window-equal (window-configuration-saved-root-window conf-1)
@@ -294,12 +309,13 @@
 
   ; avoid setting these if they're already up-to-date
   ; This also avoids potential inaccuracies in these settings --Mike
-  (let ((left (window-configuration-frame-left configuration))
-	(top (window-configuration-frame-top configuration)))
-    (if (not (equal left (frame-property frame 'left)))
-	(set-frame-property frame 'left left))
-    (if (not (equal top (frame-property frame 'top)))
-	(set-frame-property frame 'top top))) 
+  (when window-configuration-includes-position
+    (let ((left (window-configuration-frame-left configuration))
+          (top (window-configuration-frame-top configuration)))
+      (if (not (equal left (frame-property frame 'left)))
+          (set-frame-property frame 'left left))
+      (if (not (equal top (frame-property frame 'top)))
+          (set-frame-property frame 'top top))))
 
   ;; these may have changed because of the delete
   (let ((root-window (frame-root-window frame)))