aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-02-03 07:19:07 +0000
committerRichard M. Stallman2005-02-03 07:19:07 +0000
commitae473bd3ef47ac71101961bb91d3debfdc600d0d (patch)
tree1e164fa1c26b8fb7fc1122b984edca45b5d835ef
parentf6c62d96905001cee7e45e1e4e621fdcda9dabbf (diff)
downloademacs-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.texi50
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
56window. At any time, one frame is the selected frame; and the window 56window, but the other windows have ``non-selected'' cursors, normally
57selected within that frame is @dfn{the selected window}. The selected 57less visible. At any time, one frame is the selected frame; and the
58window's buffer is usually the current buffer (except when 58window selected within that frame is @dfn{the selected window}. The
59selected 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
63If this variable is @code{nil}, Emacs displays only one cursor,
64in 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
62a frame. Once removed from the frame, the window is effectively deleted 68a frame. Once removed from the frame, the window is effectively deleted
63and should not be used, @emph{even though there may still be references 69and 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{}
458This macro records the selected window, as well as the selected window 464This macro records the selected frame, as well as the selected window
459of each frame, executes @var{forms} in sequence, then restores the 465of each frame, executes @var{forms} in sequence, then restores the
460earlier selected windows. It returns the value of the last form in 466earlier selected frame and windows It returns the value of the last
461@var{forms}. 467form in @var{forms}.
462 468
463This macro does not save or restore anything about the sizes, 469This macro does not save or restore anything about the sizes,
464arrangement or contents of windows; therefore, if the @var{forms} 470arrangement 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
651This function cycles through all windows, calling @code{proc} 657This function cycles through all windows. It calls the function
652once for each window with the window as its sole argument. 658@code{proc} once for each window, with the window as its sole
659argument.
653 660
654The optional arguments @var{minibuf} and @var{all-frames} specify the 661The optional arguments @var{minibuf} and @var{all-frames} specify the
655set of windows to include in the scan. See @code{next-window}, above, 662set 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
1176As long as the selected window displays the current buffer, the window's 1183As long as the selected window displays the current buffer, the window's
1177point and the buffer's point always move together; they remain equal. 1184point 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
1184when the user switches to another buffer, the cursor jumps to the 1191when 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
2025This function makes @var{window} the right height to display its
2026contents exactly. If @var{window} is omitted or @code{nil}, it uses
2027the selected window.
2028
2029The argument @var{max-height} specifies the maximum height the window
2030is 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
2033values 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
2015This command shrinks @var{window} to be as small as possible while still 2037This command shrinks @var{window} vertically to be as small as
2016showing the full contents of its buffer---but not less than 2038possible while still showing the full contents of its buffer---but not
2017@code{window-min-height} lines. If @var{window} is not given, 2039less than @code{window-min-height} lines. If @var{window} is not
2018it defaults to the selected window. 2040given, it defaults to the selected window.
2019 2041
2020However, the command does nothing if the window is already too small to 2042However, the command does nothing if the window is already too small to
2021display the whole text of the buffer, or if part of the contents are 2043display the whole text of the buffer, or if part of the contents are