Mercurial > hg > xemacs-beta
comparison lisp/window-xemacs.el @ 4444:715c3ced8fa8
Use `real-split-window', `real-delete-window' in window-config code.
2008-04-12 Henry S. Thompson <ht@inf.ed.ac.uk>
* window-xemacs.el (real-split-window, real-delete-window): Define
these to the original definitions of `split-window' and
`delete-window', and use them in the window-configuration code to
make sure it doesn't get affected by advice to these functions.
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Sat, 12 Apr 2008 16:41:38 +0200 |
parents | 2785829fe37c |
children | 1d41b9bcf74f |
comparison
equal
deleted
inserted
replaced
4443:e7b3a3266356 | 4444:715c3ced8fa8 |
---|---|
132 frame-pixel-width frame-pixel-height | 132 frame-pixel-width frame-pixel-height |
133 current-buffer | 133 current-buffer |
134 minibuffer-pixel-height | 134 minibuffer-pixel-height |
135 min-width min-height | 135 min-width min-height |
136 saved-root-window) | 136 saved-root-window) |
137 | |
138 ; make sure we don't get affected by harmful advice | |
139 (fset 'real-split-window (symbol-function 'split-window)) | |
140 (fset 'real-delete-window (symbol-function 'delete-window)) | |
137 | 141 |
138 (defun window-configuration-equal (conf-1 conf-2) | 142 (defun window-configuration-equal (conf-1 conf-2) |
139 "Returns a boolean indicating whether the two given configurations | 143 "Returns a boolean indicating whether the two given configurations |
140 are identical. | 144 are identical. |
141 | 145 |
367 "Make sure only one subwindow of WINDOW is left." | 371 "Make sure only one subwindow of WINDOW is left." |
368 (let ((window (window-next-child window))) | 372 (let ((window (window-next-child window))) |
369 (while window | 373 (while window |
370 (if (window-live-p window) | 374 (if (window-live-p window) |
371 (let ((next (window-next-child window))) | 375 (let ((next (window-next-child window))) |
372 (delete-window window) | 376 (real-delete-window window) |
373 (setq window next))))) | 377 (setq window next))))) |
374 (cond | 378 (cond |
375 ((window-first-hchild window) | 379 ((window-first-hchild window) |
376 (window-reduce-to-one (window-first-hchild window))) | 380 (window-reduce-to-one (window-first-hchild window))) |
377 ((window-first-vchild window) | 381 ((window-first-vchild window) |
381 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." | 385 "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW." |
382 (cond | 386 (cond |
383 ((and (saved-window-next-child saved-window) | 387 ((and (saved-window-next-child saved-window) |
384 (not (saved-window-minibufferp (saved-window-next-child saved-window)))) | 388 (not (saved-window-minibufferp (saved-window-next-child saved-window)))) |
385 (cond ((eq direction 'vertical) | 389 (cond ((eq direction 'vertical) |
386 (split-window window nil nil)) | 390 (real-split-window window nil nil)) |
387 ((eq direction 'horizontal) | 391 ((eq direction 'horizontal) |
388 (split-window window nil t))) | 392 (real-split-window window nil t))) |
389 (if (not (saved-window-minibufferp saved-window)) | 393 (if (not (saved-window-minibufferp saved-window)) |
390 (restore-saved-window-parameters configuration window saved-window)) | 394 (restore-saved-window-parameters configuration window saved-window)) |
391 (restore-saved-window configuration | 395 (restore-saved-window configuration |
392 (window-next-child window) | 396 (window-next-child window) |
393 (saved-window-next-child saved-window) | 397 (saved-window-next-child saved-window) |