Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
1207:02cf044d5fce | 1208:b724c5a1f7ea |
---|---|
325 (if combination-start | 325 (if combination-start |
326 (window-reduce-to-one combination-start)))) | 326 (window-reduce-to-one combination-start)))) |
327 | 327 |
328 (defun window-reduce-to-one (window) | 328 (defun window-reduce-to-one (window) |
329 "Make sure only one subwindow of WINDOW is left." | 329 "Make sure only one subwindow of WINDOW is left." |
330 (let ((window (window-next-child window))) | 330 (let ((buffer-window (window-find-buffer-subwindow window))) |
331 (while window | 331 (delete-other-windows buffer-window))) |
332 (if (window-live-p window) | 332 |
333 (let ((next (window-next-child window))) | 333 (defun window-find-buffer-subwindow (window) |
334 (delete-window window) | 334 "Find a subwindow of window which contains a buffer." |
335 (setq window next))))) | 335 (while (not (window-buffer window)) |
336 (cond | 336 (if (window-first-vchild window) |
337 ((window-first-hchild window) | 337 (setq window (window-first-vchild window)) |
338 (window-reduce-to-one (window-first-hchild window))) | 338 (setq window (window-first-hchild window)))) |
339 ((window-first-vchild window) | 339 window) |
340 (window-reduce-to-one (window-first-vchild window))))) | |
341 | 340 |
342 (defun restore-saved-window (configuration window saved-window direction) | 341 (defun restore-saved-window (configuration window saved-window direction) |
343 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." | 342 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." |
344 (if (saved-window-next-child saved-window) | 343 (if (saved-window-next-child saved-window) |
345 (progn | 344 (progn |