- 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-top-window frame
- This returns the topmost, leftmost window of frame FRAME.
-
- 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. *Note Selecting Windows::.
-
- Another function that (usually) returns one of the windows in a
-frame is `minibuffer-window'. *Note Minibuffer Misc::.
-
-\1f
-File: lispref.info, Node: Minibuffers and Frames, Next: Input Focus, Prev: Frames and Windows, Up: Frames
-
-Minibuffers and Frames
-======================
-
- Normally, each frame has its own minibuffer window at the bottom,
-which is used whenever that frame is selected. If the frame has a
-minibuffer, you can get it with `minibuffer-window' (*note Minibuffer
-Misc::).
-
- However, you can also create a frame with no minibuffer. Such a
-frame must use the minibuffer window of some other frame. When you
-create the frame, you can specify explicitly the minibuffer window to
-use (in some other frame). If you don't, then the minibuffer is found
-in the frame which is the value of the variable
-`default-minibuffer-frame'. Its value should be a frame which does
-have a minibuffer.
-
- - Variable: default-minibuffer-frame
- This variable specifies the frame to use for the minibuffer
- window, by default.
-
-\1f
-File: lispref.info, Node: Input Focus, Next: Visibility of Frames, Prev: Minibuffers and Frames, Up: Frames
-
-Input Focus
-===========
-
- At any time, one frame in XEmacs is the "selected frame". The
-selected window always resides on the selected frame. As the focus
-moves from device to device, the selected frame on each device is
-remembered and restored when the focus moves back to that device.
-
- - Function: selected-frame &optional device
- This function returns the selected frame on DEVICE. If DEVICE is
- not specified, the selected device will be used. If no frames
- exist on the device, `nil' is returned.
-
- The X server normally directs keyboard input to the X window that the
-mouse is in. Some window managers use mouse clicks or keyboard events
-to "shift the focus" to various X windows, overriding the normal
-behavior of the server.
-
- Lisp programs can switch frames "temporarily" by calling the
-function `select-frame'. This does not override the window manager;
-rather, it escapes from the window manager's control until that control
-is somehow reasserted.
-
- When using a text-only terminal, there is no window manager;
-therefore, `select-frame' is the only way to switch frames, and the
-effect lasts until overridden by a subsequent call to `select-frame'.
-Only the selected terminal frame is actually displayed on the terminal.
-Each terminal screen except for the initial one has a number, and the
-number of the selected frame appears in the mode line after the word
-`XEmacs' (*note Modeline Variables::).
-
- - Function: select-frame frame
- This function selects frame FRAME, temporarily disregarding the
- focus of the X server if any. The selection of FRAME lasts until
- the next time the user does something to select a different frame,
- or until the next time this function is called.
-
- Note that `select-frame' does not actually cause the window-system
- focus to be set to this frame, or the `select-frame-hook' or
- `deselect-frame-hook' to be run, until the next time that XEmacs is
- waiting for an event.
-
- Also note that when the variable `focus-follows-mouse' is
- non-`nil', the frame selection is temporary and is reverted when
- the current command terminates, much like the buffer selected by
- `set-buffer'. In order to effect a permanent focus change use
- `focus-frame'.
-
- - Function: focus-frame frame
- This function selects FRAME and gives it the window system focus.
- The operation of `focus-frame' is not affected by the value of
- `focus-follows-mouse'.
-
- - Macro: save-selected-frame forms...
- This macro records the selected frame, executes FORMS in sequence,
- then restores the earlier selected frame. The value returned is
- the value of the last form.
-
- - Macro: with-selected-frame frame forms...
- This macro records the selected frame, then selects FRAME and
- executes FORMS in sequence. After the last form is finished, the
- earlier selected frame is restored. The value returned is the
- value of the last form.
+ Vertical scrolling means moving the text up or down in a window. It
+works by changing the value of the window's display-start location. It
+may also change the value of `window-point' to keep it on the screen.
+
+ In the commands `scroll-up' and `scroll-down', the directions "up"
+and "down" refer to the motion of the text in the buffer at which you
+are looking through the window. Imagine that the text is written on a
+long roll of paper and that the scrolling commands move the paper up
+and down. Thus, if you are looking at text in the middle of a buffer
+and repeatedly call `scroll-down', you will eventually see the
+beginning of the buffer.
+
+ Some people have urged that the opposite convention be used: they
+imagine that the window moves over text that remains in place. Then
+"down" commands would take you to the end of the buffer. This view is
+more consistent with the actual relationship between windows and the
+text in the buffer, but it is less like what the user sees. The
+position of a window on the terminal does not move, and short scrolling
+commands clearly move the text up or down on the screen. We have chosen
+names that fit the user's point of view.
+
+ The scrolling functions (aside from `scroll-other-window') have
+unpredictable results if the current buffer is different from the buffer
+that is displayed in the selected window. *Note Current Buffer::.
+
+ - Command: scroll-up &optional lines
+ This function scrolls the text in the selected window upward LINES
+ lines. If LINES is negative, scrolling is actually downward.
+
+ If LINES is `nil' (or omitted), then the length of scroll is
+ `next-screen-context-lines' lines less than the usable height of
+ the window (not counting its modeline).
+
+ `scroll-up' returns `nil'.
+
+ - Command: scroll-down &optional lines
+ This function scrolls the text in the selected window downward
+ LINES lines. If LINES is negative, scrolling is actually upward.
+
+ If LINES is omitted or `nil', then the length of the scroll is
+ `next-screen-context-lines' lines less than the usable height of
+ the window (not counting its mode line).
+
+ `scroll-down' returns `nil'.
+
+ - Command: scroll-other-window &optional lines
+ This function scrolls the text in another window upward LINES
+ lines. Negative values of LINES, or `nil', are handled as in
+ `scroll-up'.
+
+ You can specify a buffer to scroll with the variable
+ `other-window-scroll-buffer'. When the selected window is the
+ minibuffer, the next window is normally the one at the top left
+ corner. You can specify a different window to scroll with the
+ variable `minibuffer-scroll-window'. This variable has no effect
+ when any other window is selected. *Note Minibuffer Misc::.
+
+ When the minibuffer is active, it is the next window if the
+ selected window is the one at the bottom right corner. In this
+ case, `scroll-other-window' attempts to scroll the minibuffer. If
+ the minibuffer contains just one line, it has nowhere to scroll
+ to, so the line reappears after the echo area momentarily displays
+ the message "Beginning of buffer".
+
+ - Variable: other-window-scroll-buffer
+ If this variable is non-`nil', it tells `scroll-other-window'
+ which buffer to scroll.
+
+ - User Option: scroll-step
+ This variable controls how scrolling is done automatically when
+ point moves off the screen. If the value is zero, then redisplay
+ scrolls the text to center point vertically in the window. If the
+ value is a positive integer N, then redisplay brings point back on
+ screen by scrolling N lines in either direction, if possible;
+ otherwise, it centers point. The default value is zero.
+
+ - User Option: scroll-conservatively
+ This variable controls how many lines Emacs tries to scroll before
+ recentering. If you set it to a small number, then when you move
+ point a short distance off the screen, XEmacs will scroll the
+ screen just far enough to bring point back on screen, provided
+ that does not exceed `scroll-conservatively' lines. This variable
+ overrides the redisplay preemption.
+
+ - User Option: next-screen-context-lines
+ The value of this variable is the number of lines of continuity to
+ retain when scrolling by full screens. For example, `scroll-up'
+ with an argument of `nil' scrolls so that this many lines at the
+ bottom of the window appear instead at the top. The default value
+ is `2'.
+
+ - Command: recenter &optional location window
+ This function scrolls WINDOW (which defaults to the selected
+ window) to put the text where point is located at a specified
+ vertical position within the window.
+
+ If LOCATION is a nonnegative number, it puts the line containing
+ point LOCATION lines down from the top of the window. If LOCATION
+ is a negative number, then it counts upward from the bottom of the
+ window, so that -1 stands for the last usable line in the window.
+ If LOCATION is a non-`nil' list, then it stands for the line in
+ the middle of the window.
+
+ If LOCATION is `nil', `recenter' puts the line containing point in
+ the middle of the window, then clears and redisplays the entire
+ selected frame.
+
+ When `recenter' is called interactively, LOCATION is the raw
+ prefix argument. Thus, typing `C-u' as the prefix sets the
+ LOCATION to a non-`nil' list, while typing `C-u 4' sets LOCATION
+ to 4, which positions the current line four lines from the top.
+
+ With an argument of zero, `recenter' positions the current line at
+ the top of the window. This action is so handy that some people
+ make a separate key binding to do this. For example,
+
+ (defun line-to-top-of-window ()
+ "Scroll current line to top of window.
+ Replaces three keystroke sequence C-u 0 C-l."
+ (interactive)
+ (recenter 0))
+
+ (global-set-key [kp-multiply] 'line-to-top-of-window)