Kaarthik Sivakumar <kaarthik(a)comcast.net> wrote:
Yep I see this as you point out. There are only 2 windows now
showing
the *scratch* buffer and the cursor is in the minibuffer.
[snip]
And this also. So is there a solution to this? If there are any
suggestions I can help with trying them out.
Okay, I see the problem. In the function restore-saved-window (in
window-xemacs.el), the first-hchild and first-vchild links of a given
window are only followed if the next-child link is non-nil. But if you
look at the structure you get from current-window-configuration with the
3-window setup, you'll see windows with a null next-child and non-null
first-hchild or first-vchild links. So it looks like the patch below is
the correct fix. I've just tried every experiment I could think of with
this patch in place, and they all worked. I'll commit this in a day or
two if nobody objects.
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.514
diff -d -u -r1.514 ChangeLog
--- lisp/ChangeLog 2003/07/06 18:12:33 1.514
+++ lisp/ChangeLog 2003/07/16 16:30:06
@@ -1,3 +1,8 @@
+2003-07-16 Jerry James <james(a)xemacs.org>
+
+ * window-xemacs.el (restore-saved-window): Follow first-hchild and
+ first-vchild links even when next-child is nil.
+
2003-07-06 Adrian Aichner <adrian(a)xemacs.org>
* package-get.el (package-get-package-index-file-location): Handle
Index: lisp/window-xemacs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window-xemacs.el,v
retrieving revision 1.17
diff -d -u -r1.17 window-xemacs.el
--- lisp/window-xemacs.el 2003/03/26 15:09:51 1.17
+++ lisp/window-xemacs.el 2003/07/16 16:28:05
@@ -345,29 +345,28 @@
(defun restore-saved-window (configuration window saved-window direction)
"Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW."
- (if (saved-window-next-child saved-window)
- (progn
- (if (not (saved-window-minibufferp (saved-window-next-child saved-window)))
- (progn
- (cond ((eq direction 'vertical)
- (split-window window nil nil))
- ((eq direction 'horizontal)
- (split-window window nil t)))
- (restore-saved-window configuration
- (window-next-child window)
- (saved-window-next-child saved-window)
- direction)))
+ (and (saved-window-next-child saved-window)
+ (not (saved-window-minibufferp (saved-window-next-child saved-window)))
+ (progn
+ (cond ((eq direction 'vertical)
+ (split-window window nil nil))
+ ((eq direction 'horizontal)
+ (split-window window nil t)))
+ (restore-saved-window configuration
+ (window-next-child window)
+ (saved-window-next-child saved-window)
+ direction)))
- (if (saved-window-first-hchild saved-window)
- (restore-saved-window configuration
- window
- (saved-window-first-hchild saved-window)
- 'horizontal))
- (if (saved-window-first-vchild saved-window)
- (restore-saved-window configuration
- window
- (saved-window-first-vchild saved-window)
- 'vertical))))
+ (if (saved-window-first-hchild saved-window)
+ (restore-saved-window configuration
+ window
+ (saved-window-first-hchild saved-window)
+ 'horizontal))
+ (if (saved-window-first-vchild saved-window)
+ (restore-saved-window configuration
+ window
+ (saved-window-first-vchild saved-window)
+ 'vertical))
(if (not (saved-window-minibufferp saved-window))
(restore-saved-window-parameters configuration window saved-window)))
--
Jerry James
http://www.ittc.ku.edu/~james/