Mercurial > hg > xemacs-beta
diff lisp/window-xemacs.el @ 1208:b724c5a1f7ea
[xemacs-hg @ 2003-01-14 16:54:50 by michaels]
2003-01-10 Mike Sperber <mike@xemacs.org>
* window-xemacs.el (window-reduce-to-one): Rewrite in terms of
`delete-other-windows.'
(window-find-buffer-subwindow): Add.
author | michaels |
---|---|
date | Tue, 14 Jan 2003 16:54:51 +0000 |
parents | 8e95979f01c6 |
children | 78781398fc4c |
line wrap: on
line diff
--- a/lisp/window-xemacs.el Tue Jan 14 16:54:03 2003 +0000 +++ b/lisp/window-xemacs.el Tue Jan 14 16:54:51 2003 +0000 @@ -327,17 +327,16 @@ (defun window-reduce-to-one (window) "Make sure only one subwindow of WINDOW is left." - (let ((window (window-next-child window))) - (while window - (if (window-live-p window) - (let ((next (window-next-child window))) - (delete-window window) - (setq window next))))) - (cond - ((window-first-hchild window) - (window-reduce-to-one (window-first-hchild window))) - ((window-first-vchild window) - (window-reduce-to-one (window-first-vchild window))))) + (let ((buffer-window (window-find-buffer-subwindow window))) + (delete-other-windows buffer-window))) + +(defun window-find-buffer-subwindow (window) + "Find a subwindow of window which contains a buffer." + (while (not (window-buffer window)) + (if (window-first-vchild window) + (setq window (window-first-vchild window)) + (setq window (window-first-hchild window)))) + window) (defun restore-saved-window (configuration window saved-window direction) "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW."