(when (window-live-p save-selected-window-window)
(select-window save-selected-window-window 'norecord))))))
-;; The following two functions are like `window-next' and `window-prev'
-;; but the WINDOW argument is _not_ optional (so they don't substitute
-;; the selected window for nil), and they return nil when WINDOW doesn't
-;; have a parent (like a frame's root window or a minibuffer window).
+;; The following two functions are like `window-next-sibling' and
+;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so
+;; they don't substitute the selected window for nil), and they return
+;; nil when WINDOW doesn't have a parent (like a frame's root window or
+;; a minibuffer window).
(defsubst window-right (window)
"Return WINDOW's right sibling.
Return nil if WINDOW is the root window of its frame. WINDOW can
be any window."
- (and window (window-parent window) (window-next window)))
+ (and window (window-parent window) (window-next-sibling window)))
(defsubst window-left (window)
"Return WINDOW's left sibling.
Return nil if WINDOW is the root window of its frame. WINDOW can
be any window."
- (and window (window-parent window) (window-prev window)))
+ (and window (window-parent window) (window-prev-sibling window)))
(defsubst window-child (window)
"Return WINDOW's first child window."
- (or (window-vchild window) (window-hchild window)))
+ (or (window-top-child window) (window-left-child window)))
(defun window-child-count (window)
"Return number of WINDOW's child windows."
(when (and (windowp window) (setq window (window-child window)))
(while window
(setq count (1+ count))
- (setq window (window-next window))))
+ (setq window (window-next-sibling window))))
count))
(defun window-last-child (window)
"Return last child window of WINDOW."
(when (and (windowp window) (setq window (window-child window)))
- (while (window-next window)
- (setq window (window-next window))))
+ (while (window-next-sibling window)
+ (setq window (window-next-sibling window))))
window)
(defsubst window-any-p (object)
child if WINDOW is a horizontal combination."
(setq window (normalize-any-window window))
(if horizontal
- (window-hchild window)
- (window-vchild window)))
+ (window-left-child window)
+ (window-top-child window)))
(defsubst window-iso-combined-p (&optional window horizontal)
"Return non-nil if and only if WINDOW is vertically combined.
(funcall proc walk-window-tree-window))
(unless walk-window-tree-buffer
(walk-window-tree-1
- proc (window-hchild walk-window-tree-window) any)
+ proc (window-left-child walk-window-tree-window) any)
(walk-window-tree-1
- proc (window-vchild walk-window-tree-window) any))
+ proc (window-top-child walk-window-tree-window) any))
(if sub-only
(setq walk-window-tree-window nil)
(setq walk-window-tree-window
window t)))
;; Check children.
(unless (window-buffer window)
- (window-atom-check-1 (window-hchild window))
- (window-atom-check-1 (window-vchild window))))
+ (window-atom-check-1 (window-left-child window))
+ (window-atom-check-1 (window-top-child window))))
;; Check right sibling
(window-atom-check-1 (window-right window))))
(setq list
(cons
(cond
- ((window-vchild window)
+ ((window-top-child window)
(cons t (cons (window-edges window)
- (window-tree-1 (window-vchild window) t))))
- ((window-hchild window)
+ (window-tree-1 (window-top-child window) t))))
+ ((window-left-child window)
(cons nil (cons (window-edges window)
- (window-tree-1 (window-hchild window) t))))
+ (window-tree-1 (window-left-child window) t))))
(t window))
list))
- (setq window (when next (window-next window))))
+ (setq window (when next (window-next-sibling window))))
(nreverse list)))
(defun window-tree (&optional frame)
((not parent)
(error "Attempt to delete minibuffer or sole ordinary window")))
- (let* ((horizontal (window-hchild parent))
+ (let* ((horizontal (window-left-child parent))
(size (window-total-size window horizontal))
(frame-selected
(window-or-subwindow-p (frame-selected-window frame) window))
"Helper function for `window-state-get'."
(let* ((type
(cond
- ((window-vchild window) 'vc)
- ((window-hchild window) 'hc)
+ ((window-top-child window) 'vc)
+ ((window-left-child window) 'hc)
(t 'leaf)))
(buffer (window-buffer window))
(selected (eq window (selected-window)))
(head
(window-list-no-nils
type
- (unless (window-next window) (cons 'last t))
+ (unless (window-next-sibling window) (cons 'last t))
(cons 'clone-number (window-clone-number window))
(cons 'total-height (window-total-size window))
(cons 'total-width (window-total-size window t))
;; Don't resize minibuffer windows.
(window-minibuffer-p)
;; WINDOW must be adjacent to the selected one.
- (not (or (eq window (window-prev))
- (eq window (window-next))))))
+ (not (or (eq window (window-prev-sibling))
+ (eq window (window-next-sibling))))))
((and (window-iso-combined-p window)
;; Resize iff the selected window is higher than WINDOW.
(> (window-total-height) (window-total-height window)))
return decode_any_window (window)->parent;
}
-DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0,
- doc: /* Return WINDOW's first vertical child window.
+DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0,
+ doc: /* Return WINDOW's topmost child window.
WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no vertical child. */)
+Return nil if WINDOW is not a vertical combination. */)
(Lisp_Object window)
{
return decode_any_window (window)->vchild;
}
-DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0,
- doc: /* Return WINDOW's first horizontal child window.
+DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0,
+ doc: /* Return WINDOW's leftmost child window.
WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no horizontal child. */)
+Return nil if WINDOW is not a horizontal combination. */)
(Lisp_Object window)
{
return decode_any_window (window)->hchild;
}
-DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0,
- doc: /* Return WINDOW's right sibling window.
+DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
+ doc: /* Return WINDOW's next sibling window.
WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no right sibling. */)
+Return nil if WINDOW has no next sibling. */)
(Lisp_Object window)
{
return decode_any_window (window)->next;
}
-DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0,
- doc: /* Return WINDOW's left sibling window.
+DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
+ doc: /* Return WINDOW's previous sibling window.
WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no left sibling. */)
+Return nil if WINDOW has no previous sibling. */)
(Lisp_Object window)
{
return decode_any_window (window)->prev;
defsubr (&Swindow_clone_number);
defsubr (&Swindow_buffer);
defsubr (&Swindow_parent);
- defsubr (&Swindow_vchild);
- defsubr (&Swindow_hchild);
- defsubr (&Swindow_next);
- defsubr (&Swindow_prev);
+ defsubr (&Swindow_top_child);
+ defsubr (&Swindow_left_child);
+ defsubr (&Swindow_next_sibling);
+ defsubr (&Swindow_prev_sibling);
defsubr (&Swindow_splits);
defsubr (&Sset_window_splits);
defsubr (&Swindow_nest);