Next: , Previous: , Up: Frames   [Contents][Index]


39.6 Frames and Windows

Each window is part of one and only one frame; you can get the frame with window-frame.

Function: frame-root-window &optional frame

This returns the root window of frame frame. frame defaults to the selected frame if not specified.

Function: window-frame &optional window

This function returns the frame that window is on. window defaults to the selected window if omitted.

All the non-minibuffer windows in a frame are arranged in a cyclic order. The order runs from the frame’s top window, which is at the upper left corner, down and to the right, until it reaches the window at the lower right corner (always the minibuffer window, if the frame has one), and then it moves back to the top.

Function: frame-highest-window &optional frame position

This function returns the topmost, leftmost window of frame frame at position position.

If omitted, frame defaults to the currently selected frame.

position is used to distinguish between multiple windows that abut the top of the frame: 0 means the leftmost window abutting the top of the frame, 1 the next-leftmost, etc. position can also be less than zero: -1 means the rightmost window abutting the top of the frame, -2 the next-rightmost, etc. If omitted, position defaults to 0, i.e. the leftmost highest window. If there is no window at the given position, nil is returned.

The following three functions work similarly.

Function: frame-lowest-window &optional frame position

This function returns the lowest window on frame which is at position.

Function: frame-leftmost-window &optional frame position

This function returns the leftmost window on frame which is at position.

Function: frame-rightmost-window &optional frame position

This function returns the rightmost window on frame which is at position.

At any time, exactly one window on any frame is selected within the frame. The significance of this designation is that selecting the frame also selects this window. You can get the frame’s current selected window with frame-selected-window.

Function: frame-selected-window &optional frame

This function returns the window on frame that is selected within frame. frame defaults to the selected frame if not specified.

Conversely, selecting a window for XEmacs with select-window also makes that window selected within its frame. See Selecting Windows.

Another function that (usually) returns one of the windows in a frame is minibuffer-window. See Minibuffer Misc.


Next: , Previous: , Up: Frames   [Contents][Index]