diff options
| author | Richard M. Stallman | 2005-02-03 07:19:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-02-03 07:19:07 +0000 |
| commit | ae473bd3ef47ac71101961bb91d3debfdc600d0d (patch) | |
| tree | 1e164fa1c26b8fb7fc1122b984edca45b5d835ef | |
| parent | f6c62d96905001cee7e45e1e4e621fdcda9dabbf (diff) | |
| download | emacs-ae473bd3ef47ac71101961bb91d3debfdc600d0d.tar.gz emacs-ae473bd3ef47ac71101961bb91d3debfdc600d0d.zip | |
(Basic Windows): Add cursor-in-non-selected-windows. Clarify.
(Selecting Windows): Clarify save-selected-window.
(Cyclic Window Ordering): Clarify walk-windows.
(Window Point): Clarify.
(Window Start): Add comment to example.
(Resizing Windows): Add `interactive' specs in examples.
Document fit-window-to-buffer.
| -rw-r--r-- | lispref/windows.texi | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/lispref/windows.texi b/lispref/windows.texi index 5041fb5b2df..671175a550d 100644 --- a/lispref/windows.texi +++ b/lispref/windows.texi | |||
| @@ -53,11 +53,17 @@ multiple nonoverlapping Emacs windows. | |||
| 53 | 53 | ||
| 54 | In each frame, at any time, one and only one window is designated as | 54 | In each frame, at any time, one and only one window is designated as |
| 55 | @dfn{selected within the frame}. The frame's cursor appears in that | 55 | @dfn{selected within the frame}. The frame's cursor appears in that |
| 56 | window. At any time, one frame is the selected frame; and the window | 56 | window, but the other windows have ``non-selected'' cursors, normally |
| 57 | selected within that frame is @dfn{the selected window}. The selected | 57 | less visible. At any time, one frame is the selected frame; and the |
| 58 | window's buffer is usually the current buffer (except when | 58 | window selected within that frame is @dfn{the selected window}. The |
| 59 | selected window's buffer is usually the current buffer (except when | ||
| 59 | @code{set-buffer} has been used). @xref{Current Buffer}. | 60 | @code{set-buffer} has been used). @xref{Current Buffer}. |
| 60 | 61 | ||
| 62 | @defvar cursor-in-non-selected-windows | ||
| 63 | If this variable is @code{nil}, Emacs displays only one cursor, | ||
| 64 | in the selected window. Other windows have no cursor at all. | ||
| 65 | @end defvar | ||
| 66 | |||
| 61 | For practical purposes, a window exists only while it is displayed in | 67 | For practical purposes, a window exists only while it is displayed in |
| 62 | a frame. Once removed from the frame, the window is effectively deleted | 68 | a frame. Once removed from the frame, the window is effectively deleted |
| 63 | and should not be used, @emph{even though there may still be references | 69 | and should not be used, @emph{even though there may still be references |
| @@ -455,10 +461,10 @@ The return value is @var{window}. | |||
| 455 | @end defun | 461 | @end defun |
| 456 | 462 | ||
| 457 | @defmac save-selected-window forms@dots{} | 463 | @defmac save-selected-window forms@dots{} |
| 458 | This macro records the selected window, as well as the selected window | 464 | This macro records the selected frame, as well as the selected window |
| 459 | of each frame, executes @var{forms} in sequence, then restores the | 465 | of each frame, executes @var{forms} in sequence, then restores the |
| 460 | earlier selected windows. It returns the value of the last form in | 466 | earlier selected frame and windows It returns the value of the last |
| 461 | @var{forms}. | 467 | form in @var{forms}. |
| 462 | 468 | ||
| 463 | This macro does not save or restore anything about the sizes, | 469 | This macro does not save or restore anything about the sizes, |
| 464 | arrangement or contents of windows; therefore, if the @var{forms} | 470 | 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. | |||
| 648 | 654 | ||
| 649 | @c Emacs 19 feature | 655 | @c Emacs 19 feature |
| 650 | @defun walk-windows proc &optional minibuf all-frames | 656 | @defun walk-windows proc &optional minibuf all-frames |
| 651 | This function cycles through all windows, calling @code{proc} | 657 | This function cycles through all windows. It calls the function |
| 652 | once for each window with the window as its sole argument. | 658 | @code{proc} once for each window, with the window as its sole |
| 659 | argument. | ||
| 653 | 660 | ||
| 654 | The optional arguments @var{minibuf} and @var{all-frames} specify the | 661 | The optional arguments @var{minibuf} and @var{all-frames} specify the |
| 655 | set of windows to include in the scan. See @code{next-window}, above, | 662 | set of windows to include in the scan. See @code{next-window}, above, |
| @@ -1175,10 +1182,10 @@ the other windows are stored in those windows. | |||
| 1175 | @item | 1182 | @item |
| 1176 | As long as the selected window displays the current buffer, the window's | 1183 | As long as the selected window displays the current buffer, the window's |
| 1177 | point and the buffer's point always move together; they remain equal. | 1184 | point and the buffer's point always move together; they remain equal. |
| 1185 | @end itemize | ||
| 1178 | 1186 | ||
| 1179 | @item | 1187 | @noindent |
| 1180 | @xref{Positions}, for more details on buffer positions. | 1188 | @xref{Positions}, for more details on buffer positions. |
| 1181 | @end itemize | ||
| 1182 | 1189 | ||
| 1183 | As far as the user is concerned, point is where the cursor is, and | 1190 | As far as the user is concerned, point is where the cursor is, and |
| 1184 | when the user switches to another buffer, the cursor jumps to the | 1191 | when the user switches to another buffer, the cursor jumps to the |
| @@ -1356,6 +1363,7 @@ Here is an example: | |||
| 1356 | 1363 | ||
| 1357 | @example | 1364 | @example |
| 1358 | @group | 1365 | @group |
| 1366 | ;; @r{If point is off the screen now, recenter it now.} | ||
| 1359 | (or (pos-visible-in-window-p | 1367 | (or (pos-visible-in-window-p |
| 1360 | (point) (selected-window)) | 1368 | (point) (selected-window)) |
| 1361 | (recenter 0)) | 1369 | (recenter 0)) |
| @@ -1984,6 +1992,7 @@ It could be defined as follows: | |||
| 1984 | @example | 1992 | @example |
| 1985 | @group | 1993 | @group |
| 1986 | (defun enlarge-window-horizontally (columns) | 1994 | (defun enlarge-window-horizontally (columns) |
| 1995 | (interactive "p") | ||
| 1987 | (enlarge-window columns t)) | 1996 | (enlarge-window columns t)) |
| 1988 | @end group | 1997 | @end group |
| 1989 | @end example | 1998 | @end example |
| @@ -2006,16 +2015,29 @@ It could be defined as follows: | |||
| 2006 | @example | 2015 | @example |
| 2007 | @group | 2016 | @group |
| 2008 | (defun shrink-window-horizontally (columns) | 2017 | (defun shrink-window-horizontally (columns) |
| 2018 | (interactive "p") | ||
| 2009 | (shrink-window columns t)) | 2019 | (shrink-window columns t)) |
| 2010 | @end group | 2020 | @end group |
| 2011 | @end example | 2021 | @end example |
| 2012 | @end deffn | 2022 | @end deffn |
| 2013 | 2023 | ||
| 2024 | @defun fit-window-to-buffer &optional window max-height min-height | ||
| 2025 | This function makes @var{window} the right height to display its | ||
| 2026 | contents exactly. If @var{window} is omitted or @code{nil}, it uses | ||
| 2027 | the selected window. | ||
| 2028 | |||
| 2029 | The argument @var{max-height} specifies the maximum height the window | ||
| 2030 | is allowed to be; @code{nil} means use the frame height. The argument | ||
| 2031 | @var{min-height} specifies the minimum height for the window; | ||
| 2032 | @code{nil} means use @code{window-min-height}. All these height | ||
| 2033 | values include the mode-line and/or header-line. | ||
| 2034 | @end defun | ||
| 2035 | |||
| 2014 | @deffn Command shrink-window-if-larger-than-buffer &optional window | 2036 | @deffn Command shrink-window-if-larger-than-buffer &optional window |
| 2015 | This command shrinks @var{window} to be as small as possible while still | 2037 | This command shrinks @var{window} vertically to be as small as |
| 2016 | showing the full contents of its buffer---but not less than | 2038 | possible while still showing the full contents of its buffer---but not |
| 2017 | @code{window-min-height} lines. If @var{window} is not given, | 2039 | less than @code{window-min-height} lines. If @var{window} is not |
| 2018 | it defaults to the selected window. | 2040 | given, it defaults to the selected window. |
| 2019 | 2041 | ||
| 2020 | However, the command does nothing if the window is already too small to | 2042 | However, the command does nothing if the window is already too small to |
| 2021 | display the whole text of the buffer, or if part of the contents are | 2043 | display the whole text of the buffer, or if part of the contents are |