diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/window.el | 55 |
2 files changed, 40 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e65f7334754..b53365d7d35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-06-27 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window-right, window-left, window-child) | ||
| 4 | (window-child-count, window-last-child) | ||
| 5 | (window-iso-combination-p, walk-window-tree-1) | ||
| 6 | (window-atom-check-1, window-tree-1, delete-window) | ||
| 7 | (window-state-get-1, display-buffer-even-window-sizes): Adapt to | ||
| 8 | new naming conventions - window-vchild, window-hchild, | ||
| 9 | window-next and window-prev are now called window-top-child, | ||
| 10 | window-left-child, window-next-sibling and window-prev-sibling | ||
| 11 | respectively. | ||
| 12 | |||
| 1 | 2011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> | 13 | 2011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> |
| 2 | 14 | ||
| 3 | * ses.el (ses-destroy-cell-variable-range): Fix heading comment | 15 | * ses.el (ses-destroy-cell-variable-range): Fix heading comment |
diff --git a/lisp/window.el b/lisp/window.el index ddbfdcf2454..3d65acd22a6 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -63,25 +63,26 @@ are not altered by this macro (unless they are altered in BODY)." | |||
| 63 | (when (window-live-p save-selected-window-window) | 63 | (when (window-live-p save-selected-window-window) |
| 64 | (select-window save-selected-window-window 'norecord)))))) | 64 | (select-window save-selected-window-window 'norecord)))))) |
| 65 | 65 | ||
| 66 | ;; The following two functions are like `window-next' and `window-prev' | 66 | ;; The following two functions are like `window-next-sibling' and |
| 67 | ;; but the WINDOW argument is _not_ optional (so they don't substitute | 67 | ;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so |
| 68 | ;; the selected window for nil), and they return nil when WINDOW doesn't | 68 | ;; they don't substitute the selected window for nil), and they return |
| 69 | ;; have a parent (like a frame's root window or a minibuffer window). | 69 | ;; nil when WINDOW doesn't have a parent (like a frame's root window or |
| 70 | ;; a minibuffer window). | ||
| 70 | (defsubst window-right (window) | 71 | (defsubst window-right (window) |
| 71 | "Return WINDOW's right sibling. | 72 | "Return WINDOW's right sibling. |
| 72 | Return nil if WINDOW is the root window of its frame. WINDOW can | 73 | Return nil if WINDOW is the root window of its frame. WINDOW can |
| 73 | be any window." | 74 | be any window." |
| 74 | (and window (window-parent window) (window-next window))) | 75 | (and window (window-parent window) (window-next-sibling window))) |
| 75 | 76 | ||
| 76 | (defsubst window-left (window) | 77 | (defsubst window-left (window) |
| 77 | "Return WINDOW's left sibling. | 78 | "Return WINDOW's left sibling. |
| 78 | Return nil if WINDOW is the root window of its frame. WINDOW can | 79 | Return nil if WINDOW is the root window of its frame. WINDOW can |
| 79 | be any window." | 80 | be any window." |
| 80 | (and window (window-parent window) (window-prev window))) | 81 | (and window (window-parent window) (window-prev-sibling window))) |
| 81 | 82 | ||
| 82 | (defsubst window-child (window) | 83 | (defsubst window-child (window) |
| 83 | "Return WINDOW's first child window." | 84 | "Return WINDOW's first child window." |
| 84 | (or (window-vchild window) (window-hchild window))) | 85 | (or (window-top-child window) (window-left-child window))) |
| 85 | 86 | ||
| 86 | (defun window-child-count (window) | 87 | (defun window-child-count (window) |
| 87 | "Return number of WINDOW's child windows." | 88 | "Return number of WINDOW's child windows." |
| @@ -89,14 +90,14 @@ be any window." | |||
| 89 | (when (and (windowp window) (setq window (window-child window))) | 90 | (when (and (windowp window) (setq window (window-child window))) |
| 90 | (while window | 91 | (while window |
| 91 | (setq count (1+ count)) | 92 | (setq count (1+ count)) |
| 92 | (setq window (window-next window)))) | 93 | (setq window (window-next-sibling window)))) |
| 93 | count)) | 94 | count)) |
| 94 | 95 | ||
| 95 | (defun window-last-child (window) | 96 | (defun window-last-child (window) |
| 96 | "Return last child window of WINDOW." | 97 | "Return last child window of WINDOW." |
| 97 | (when (and (windowp window) (setq window (window-child window))) | 98 | (when (and (windowp window) (setq window (window-child window))) |
| 98 | (while (window-next window) | 99 | (while (window-next-sibling window) |
| 99 | (setq window (window-next window)))) | 100 | (setq window (window-next-sibling window)))) |
| 100 | window) | 101 | window) |
| 101 | 102 | ||
| 102 | (defsubst window-any-p (object) | 103 | (defsubst window-any-p (object) |
| @@ -203,8 +204,8 @@ Optional argument HORIZONTAL non-nil means return WINDOW's first | |||
| 203 | child if WINDOW is a horizontal combination." | 204 | child if WINDOW is a horizontal combination." |
| 204 | (setq window (normalize-any-window window)) | 205 | (setq window (normalize-any-window window)) |
| 205 | (if horizontal | 206 | (if horizontal |
| 206 | (window-hchild window) | 207 | (window-left-child window) |
| 207 | (window-vchild window))) | 208 | (window-top-child window))) |
| 208 | 209 | ||
| 209 | (defsubst window-iso-combined-p (&optional window horizontal) | 210 | (defsubst window-iso-combined-p (&optional window horizontal) |
| 210 | "Return non-nil if and only if WINDOW is vertically combined. | 211 | "Return non-nil if and only if WINDOW is vertically combined. |
| @@ -258,9 +259,9 @@ number of horizontally arranged subwindows of WINDOW." | |||
| 258 | (funcall proc walk-window-tree-window)) | 259 | (funcall proc walk-window-tree-window)) |
| 259 | (unless walk-window-tree-buffer | 260 | (unless walk-window-tree-buffer |
| 260 | (walk-window-tree-1 | 261 | (walk-window-tree-1 |
| 261 | proc (window-hchild walk-window-tree-window) any) | 262 | proc (window-left-child walk-window-tree-window) any) |
| 262 | (walk-window-tree-1 | 263 | (walk-window-tree-1 |
| 263 | proc (window-vchild walk-window-tree-window) any)) | 264 | proc (window-top-child walk-window-tree-window) any)) |
| 264 | (if sub-only | 265 | (if sub-only |
| 265 | (setq walk-window-tree-window nil) | 266 | (setq walk-window-tree-window nil) |
| 266 | (setq walk-window-tree-window | 267 | (setq walk-window-tree-window |
| @@ -375,8 +376,8 @@ WINDOW must be an internal window. Return WINDOW." | |||
| 375 | window t))) | 376 | window t))) |
| 376 | ;; Check children. | 377 | ;; Check children. |
| 377 | (unless (window-buffer window) | 378 | (unless (window-buffer window) |
| 378 | (window-atom-check-1 (window-hchild window)) | 379 | (window-atom-check-1 (window-left-child window)) |
| 379 | (window-atom-check-1 (window-vchild window)))) | 380 | (window-atom-check-1 (window-top-child window)))) |
| 380 | ;; Check right sibling | 381 | ;; Check right sibling |
| 381 | (window-atom-check-1 (window-right window)))) | 382 | (window-atom-check-1 (window-right window)))) |
| 382 | 383 | ||
| @@ -2119,15 +2120,15 @@ return value." | |||
| 2119 | (setq list | 2120 | (setq list |
| 2120 | (cons | 2121 | (cons |
| 2121 | (cond | 2122 | (cond |
| 2122 | ((window-vchild window) | 2123 | ((window-top-child window) |
| 2123 | (cons t (cons (window-edges window) | 2124 | (cons t (cons (window-edges window) |
| 2124 | (window-tree-1 (window-vchild window) t)))) | 2125 | (window-tree-1 (window-top-child window) t)))) |
| 2125 | ((window-hchild window) | 2126 | ((window-left-child window) |
| 2126 | (cons nil (cons (window-edges window) | 2127 | (cons nil (cons (window-edges window) |
| 2127 | (window-tree-1 (window-hchild window) t)))) | 2128 | (window-tree-1 (window-left-child window) t)))) |
| 2128 | (t window)) | 2129 | (t window)) |
| 2129 | list)) | 2130 | list)) |
| 2130 | (setq window (when next (window-next window)))) | 2131 | (setq window (when next (window-next-sibling window)))) |
| 2131 | (nreverse list))) | 2132 | (nreverse list))) |
| 2132 | 2133 | ||
| 2133 | (defun window-tree (&optional frame) | 2134 | (defun window-tree (&optional frame) |
| @@ -2363,7 +2364,7 @@ non-side window, signal an error." | |||
| 2363 | ((not parent) | 2364 | ((not parent) |
| 2364 | (error "Attempt to delete minibuffer or sole ordinary window"))) | 2365 | (error "Attempt to delete minibuffer or sole ordinary window"))) |
| 2365 | 2366 | ||
| 2366 | (let* ((horizontal (window-hchild parent)) | 2367 | (let* ((horizontal (window-left-child parent)) |
| 2367 | (size (window-total-size window horizontal)) | 2368 | (size (window-total-size window horizontal)) |
| 2368 | (frame-selected | 2369 | (frame-selected |
| 2369 | (window-or-subwindow-p (frame-selected-window frame) window)) | 2370 | (window-or-subwindow-p (frame-selected-window frame) window)) |
| @@ -3524,15 +3525,15 @@ specific buffers." | |||
| 3524 | "Helper function for `window-state-get'." | 3525 | "Helper function for `window-state-get'." |
| 3525 | (let* ((type | 3526 | (let* ((type |
| 3526 | (cond | 3527 | (cond |
| 3527 | ((window-vchild window) 'vc) | 3528 | ((window-top-child window) 'vc) |
| 3528 | ((window-hchild window) 'hc) | 3529 | ((window-left-child window) 'hc) |
| 3529 | (t 'leaf))) | 3530 | (t 'leaf))) |
| 3530 | (buffer (window-buffer window)) | 3531 | (buffer (window-buffer window)) |
| 3531 | (selected (eq window (selected-window))) | 3532 | (selected (eq window (selected-window))) |
| 3532 | (head | 3533 | (head |
| 3533 | (window-list-no-nils | 3534 | (window-list-no-nils |
| 3534 | type | 3535 | type |
| 3535 | (unless (window-next window) (cons 'last t)) | 3536 | (unless (window-next-sibling window) (cons 'last t)) |
| 3536 | (cons 'clone-number (window-clone-number window)) | 3537 | (cons 'clone-number (window-clone-number window)) |
| 3537 | (cons 'total-height (window-total-size window)) | 3538 | (cons 'total-height (window-total-size window)) |
| 3538 | (cons 'total-width (window-total-size window t)) | 3539 | (cons 'total-width (window-total-size window t)) |
| @@ -4666,8 +4667,8 @@ larger than WINDOW." | |||
| 4666 | ;; Don't resize minibuffer windows. | 4667 | ;; Don't resize minibuffer windows. |
| 4667 | (window-minibuffer-p) | 4668 | (window-minibuffer-p) |
| 4668 | ;; WINDOW must be adjacent to the selected one. | 4669 | ;; WINDOW must be adjacent to the selected one. |
| 4669 | (not (or (eq window (window-prev)) | 4670 | (not (or (eq window (window-prev-sibling)) |
| 4670 | (eq window (window-next)))))) | 4671 | (eq window (window-next-sibling)))))) |
| 4671 | ((and (window-iso-combined-p window) | 4672 | ((and (window-iso-combined-p window) |
| 4672 | ;; Resize iff the selected window is higher than WINDOW. | 4673 | ;; Resize iff the selected window is higher than WINDOW. |
| 4673 | (> (window-total-height) (window-total-height window))) | 4674 | (> (window-total-height) (window-total-height window))) |