Mercurial > hg > xemacs-beta
comparison lisp/window-xemacs.el @ 1230:78781398fc4c
[xemacs-hg @ 2003-01-23 10:09:41 by michaels]
2003-01-10 Mike Sperber <mike@xemacs.org>
* window-xemacs.el: Revert his change
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.
It caused subtle breakage. (And add a comment to that effect.)
author | michaels |
---|---|
date | Thu, 23 Jan 2003 10:09:41 +0000 |
parents | b724c5a1f7ea |
children | 465bd3c7d932 |
comparison
equal
deleted
inserted
replaced
1229:416490619c01 | 1230:78781398fc4c |
---|---|
323 (combination-start (or (window-first-hchild root-window) | 323 (combination-start (or (window-first-hchild root-window) |
324 (window-first-vchild root-window)))) | 324 (window-first-vchild root-window)))) |
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 ;; Note that simply using `delete-other-windows' causes obscure | |
329 ;; breakage. --Mike | |
330 | |
328 (defun window-reduce-to-one (window) | 331 (defun window-reduce-to-one (window) |
329 "Make sure only one subwindow of WINDOW is left." | 332 "Make sure only one subwindow of WINDOW is left." |
330 (let ((buffer-window (window-find-buffer-subwindow window))) | 333 (let ((window (window-next-child window))) |
331 (delete-other-windows buffer-window))) | 334 (while window |
332 | 335 (if (window-live-p window) |
333 (defun window-find-buffer-subwindow (window) | 336 (let ((next (window-next-child window))) |
334 "Find a subwindow of window which contains a buffer." | 337 (delete-window window) |
335 (while (not (window-buffer window)) | 338 (setq window next))))) |
336 (if (window-first-vchild window) | 339 (cond |
337 (setq window (window-first-vchild window)) | 340 ((window-first-hchild window) |
338 (setq window (window-first-hchild window)))) | 341 (window-reduce-to-one (window-first-hchild window))) |
339 window) | 342 ((window-first-vchild window) |
343 (window-reduce-to-one (window-first-vchild window))))) | |
340 | 344 |
341 (defun restore-saved-window (configuration window saved-window direction) | 345 (defun restore-saved-window (configuration window saved-window direction) |
342 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." | 346 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." |
343 (if (saved-window-next-child saved-window) | 347 (if (saved-window-next-child saved-window) |
344 (progn | 348 (progn |