diff options
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/window.el | 55 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/window.c | 32 |
4 files changed, 61 insertions, 43 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))) |
diff --git a/src/ChangeLog b/src/ChangeLog index 56ffc1036d5..4d8bb0a5638 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -5,6 +5,11 @@ | |||
| 5 | matches the window's clone number process the overlay even if | 5 | matches the window's clone number process the overlay even if |
| 6 | the overlay's window property doesn't match the current window. | 6 | the overlay's window property doesn't match the current window. |
| 7 | 7 | ||
| 8 | * window.c (Fwindow_vchild): Rename to Fwindow_top_child. | ||
| 9 | (Fwindow_hchild): Rename to Fwindow_left_child. | ||
| 10 | (Fwindow_next): Rename to Fwindow_next_sibling. | ||
| 11 | (Fwindow_prev): Rename to Fwindow_prev_sibling. | ||
| 12 | |||
| 8 | 2011-06-26 Jan Djärv <jan.h.d@swipnet.se> | 13 | 2011-06-26 Jan Djärv <jan.h.d@swipnet.se> |
| 9 | 14 | ||
| 10 | * emacsgtkfixed.h: State that this is only used with Gtk+3. | 15 | * emacsgtkfixed.h: State that this is only used with Gtk+3. |
diff --git a/src/window.c b/src/window.c index 50d4a92a4c5..19b3edf4c77 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -434,37 +434,37 @@ Return nil if WINDOW has no parent. */) | |||
| 434 | return decode_any_window (window)->parent; | 434 | return decode_any_window (window)->parent; |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0, | 437 | DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0, |
| 438 | doc: /* Return WINDOW's first vertical child window. | 438 | doc: /* Return WINDOW's topmost child window. |
| 439 | WINDOW can be any window and defaults to the selected one. | 439 | WINDOW can be any window and defaults to the selected one. |
| 440 | Return nil if WINDOW has no vertical child. */) | 440 | Return nil if WINDOW is not a vertical combination. */) |
| 441 | (Lisp_Object window) | 441 | (Lisp_Object window) |
| 442 | { | 442 | { |
| 443 | return decode_any_window (window)->vchild; | 443 | return decode_any_window (window)->vchild; |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0, | 446 | DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0, |
| 447 | doc: /* Return WINDOW's first horizontal child window. | 447 | doc: /* Return WINDOW's leftmost child window. |
| 448 | WINDOW can be any window and defaults to the selected one. | 448 | WINDOW can be any window and defaults to the selected one. |
| 449 | Return nil if WINDOW has no horizontal child. */) | 449 | Return nil if WINDOW is not a horizontal combination. */) |
| 450 | (Lisp_Object window) | 450 | (Lisp_Object window) |
| 451 | { | 451 | { |
| 452 | return decode_any_window (window)->hchild; | 452 | return decode_any_window (window)->hchild; |
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0, | 455 | DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, |
| 456 | doc: /* Return WINDOW's right sibling window. | 456 | doc: /* Return WINDOW's next sibling window. |
| 457 | WINDOW can be any window and defaults to the selected one. | 457 | WINDOW can be any window and defaults to the selected one. |
| 458 | Return nil if WINDOW has no right sibling. */) | 458 | Return nil if WINDOW has no next sibling. */) |
| 459 | (Lisp_Object window) | 459 | (Lisp_Object window) |
| 460 | { | 460 | { |
| 461 | return decode_any_window (window)->next; | 461 | return decode_any_window (window)->next; |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0, | 464 | DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, |
| 465 | doc: /* Return WINDOW's left sibling window. | 465 | doc: /* Return WINDOW's previous sibling window. |
| 466 | WINDOW can be any window and defaults to the selected one. | 466 | WINDOW can be any window and defaults to the selected one. |
| 467 | Return nil if WINDOW has no left sibling. */) | 467 | Return nil if WINDOW has no previous sibling. */) |
| 468 | (Lisp_Object window) | 468 | (Lisp_Object window) |
| 469 | { | 469 | { |
| 470 | return decode_any_window (window)->prev; | 470 | return decode_any_window (window)->prev; |
| @@ -6598,10 +6598,10 @@ function `window-nest' and altered by the function `set-window-nest'. */); | |||
| 6598 | defsubr (&Swindow_clone_number); | 6598 | defsubr (&Swindow_clone_number); |
| 6599 | defsubr (&Swindow_buffer); | 6599 | defsubr (&Swindow_buffer); |
| 6600 | defsubr (&Swindow_parent); | 6600 | defsubr (&Swindow_parent); |
| 6601 | defsubr (&Swindow_vchild); | 6601 | defsubr (&Swindow_top_child); |
| 6602 | defsubr (&Swindow_hchild); | 6602 | defsubr (&Swindow_left_child); |
| 6603 | defsubr (&Swindow_next); | 6603 | defsubr (&Swindow_next_sibling); |
| 6604 | defsubr (&Swindow_prev); | 6604 | defsubr (&Swindow_prev_sibling); |
| 6605 | defsubr (&Swindow_splits); | 6605 | defsubr (&Swindow_splits); |
| 6606 | defsubr (&Sset_window_splits); | 6606 | defsubr (&Sset_window_splits); |
| 6607 | defsubr (&Swindow_nest); | 6607 | defsubr (&Swindow_nest); |