]> code.delx.au - gnu-emacs/blobdiff - lispref/windows.texi
(Defining Faces): Add `customized-face'.
[gnu-emacs] / lispref / windows.texi
index 5041fb5b2df09c8636f5f109de8329e8e460f10b..d9ecf5db7eb75fc121b0d2a02e3c43e969b027a7 100644 (file)
@@ -53,11 +53,17 @@ multiple nonoverlapping Emacs windows.
 
   In each frame, at any time, one and only one window is designated as
 @dfn{selected within the frame}.  The frame's cursor appears in that
-window.  At any time, one frame is the selected frame; and the window
-selected within that frame is @dfn{the selected window}.  The selected
-window's buffer is usually the current buffer (except when
+window, but the other windows have ``non-selected'' cursors, normally
+less visible.  At any time, one frame is the selected frame; and the
+window selected within that frame is @dfn{the selected window}.  The
+selected window's buffer is usually the current buffer (except when
 @code{set-buffer} has been used).  @xref{Current Buffer}.
 
+@defvar cursor-in-non-selected-windows
+If this variable is @code{nil}, Emacs displays only one cursor,
+in the selected window.  Other windows have no cursor at all.
+@end defvar
+
   For practical purposes, a window exists only while it is displayed in
 a frame.  Once removed from the frame, the window is effectively deleted
 and should not be used, @emph{even though there may still be references
@@ -455,10 +461,10 @@ The return value is @var{window}.
 @end defun
 
 @defmac save-selected-window forms@dots{}
-This macro records the selected window, as well as the selected window
+This macro records the selected frame, as well as the selected window
 of each frame, executes @var{forms} in sequence, then restores the
-earlier selected windows.  It returns the value of the last form in
-@var{forms}.
+earlier selected frame and windows It returns the value of the last
+form in @var{forms}.
 
 This macro does not save or restore anything about the sizes,
 arrangement or contents of windows; therefore, if the @var{forms}
@@ -648,8 +654,9 @@ In an interactive call, @var{count} is the numeric prefix argument.
 
 @c Emacs 19 feature
 @defun walk-windows proc &optional minibuf all-frames
-This function cycles through all windows, calling @code{proc}
-once for each window with the window as its sole argument.
+This function cycles through all windows.  It calls the function
+@code{proc} once for each window, with the window as its sole
+argument.
 
 The optional arguments @var{minibuf} and @var{all-frames} specify the
 set of windows to include in the scan.  See @code{next-window}, above,
@@ -658,17 +665,16 @@ for details.
 
 @defun window-list &optional frame minibuf window
 This function returns a list of the windows on @var{frame}, starting
-with @var{window}.  If @var{frame} is @code{nil} or omitted, the
-selected frame is used instead; if @var{window} is @code{nil} or
-omitted, the selected window is used instead.
-
-The value of @var{minibuf} determines if the minibuffer window will be
-included in the result list.  If @var{minibuf} is @code{t}, the
-minibuffer window will be included, even if it isn't active.  If
-@var{minibuf} is @code{nil} or omitted, the minibuffer window will
-only be included in the list if it is active.  If @var{minibuf} is
-neither @code{nil} nor @code{t}, the minibuffer window is not
-included, whether or not it is active.
+with @var{window}.  If @var{frame} is @code{nil} or omitted,
+@code{window-list} uses the selected frame instead; if @var{window} is
+@code{nil} or omitted, it uses the selected window.
+
+The value of @var{minibuf} determines if the minibuffer window is
+included in the result list.  If @var{minibuf} is @code{t}, the result
+always includes the minibuffer window.  If @var{minibuf} is @code{nil}
+or omitted, that includes the minibuffer window if it is active.  If
+@var{minibuf} is neither @code{nil} nor @code{t}, the result never
+includes the minibuffer window.
 @end defun
 
 @node Buffers and Windows
@@ -1175,10 +1181,10 @@ the other windows are stored in those windows.
 @item
 As long as the selected window displays the current buffer, the window's
 point and the buffer's point always move together; they remain equal.
+@end itemize
 
-@item
+@noindent
 @xref{Positions}, for more details on buffer positions.
-@end itemize
 
   As far as the user is concerned, point is where the cursor is, and
 when the user switches to another buffer, the cursor jumps to the
@@ -1356,6 +1362,7 @@ Here is an example:
 
 @example
 @group
+;; @r{If point is off the screen now, recenter it now.}
 (or (pos-visible-in-window-p
      (point) (selected-window))
     (recenter 0))
@@ -1575,7 +1582,7 @@ Replaces three keystroke sequence C-u 0 C-l."
 
   @dfn{Vertical fractional scrolling} means shifting the image in the
 window up or down by a specified multiple or fraction of a line.
-Starting in Emacs 21, each window has a @dfn{vertical scroll position},
+Each window has a @dfn{vertical scroll position},
 which is a number, never less than zero.  It specifies how far to raise
 the contents of the window.  Raising the window contents generally makes
 all or part of some lines disappear off the top, and all or part of some
@@ -1984,6 +1991,7 @@ It could be defined as follows:
 @example
 @group
 (defun enlarge-window-horizontally (columns)
+  (interactive "p")
   (enlarge-window columns t))
 @end group
 @end example
@@ -2006,16 +2014,29 @@ It could be defined as follows:
 @example
 @group
 (defun shrink-window-horizontally (columns)
+  (interactive "p")
   (shrink-window columns t))
 @end group
 @end example
 @end deffn
 
+@defun fit-window-to-buffer &optional window max-height min-height
+This function makes @var{window} the right height to display its
+contents exactly.  If @var{window} is omitted or @code{nil}, it uses
+the selected window.
+
+The argument @var{max-height} specifies the maximum height the window
+is allowed to be; @code{nil} means use the frame height.  The argument
+@var{min-height} specifies the minimum height for the window;
+@code{nil} means use @code{window-min-height}.  All these height
+values include the mode-line and/or header-line.
+@end defun
+
 @deffn Command shrink-window-if-larger-than-buffer &optional window
-This command shrinks @var{window} to be as small as possible while still
-showing the full contents of its buffer---but not less than
-@code{window-min-height} lines.  If @var{window} is not given,
-it defaults to the selected window.
+This command shrinks @var{window} vertically to be as small as
+possible while still showing the full contents of its buffer---but not
+less than @code{window-min-height} lines.  If @var{window} is not
+given, it defaults to the selected window.
 
 However, the command does nothing if the window is already too small to
 display the whole text of the buffer, or if part of the contents are
@@ -2031,7 +2052,6 @@ and @code{nil} otherwise.
 If this variable is non-@code{nil}, in any given buffer,
 then the size of any window displaying the buffer remains fixed
 unless you explicitly change it or Emacs has no other choice.
-(This feature is new in Emacs 21.)
 
 If the value is @code{height}, then only the window's height is fixed;
 if the value is @code{width}, then only the window's width is fixed.
@@ -2268,8 +2288,7 @@ window displays a different part of its buffer or a different buffer.
 There are three actions that can change this: scrolling the window,
 switching buffers in the window, and changing the size of the window.
 The first two actions run @code{window-scroll-functions}; the last runs
-@code{window-size-change-functions}.  The paradigmatic use of these
-hooks is in the implementation of Lazy Lock mode; see @file{lazy-lock.el}.
+@code{window-size-change-functions}.
 
 @defvar window-scroll-functions
 This variable holds a list of functions that Emacs should call before