aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-07-14 16:04:44 +0000
committerRichard M. Stallman2003-07-14 16:04:44 +0000
commit5a8a6af88020e8f599f876d14878358e2d2756de (patch)
treee79d40692087b451afcc0d8e0929575dee0016d3
parente73c3ec468a3e3ab6a521dee6b053f74d03c0d08 (diff)
downloademacs-5a8a6af88020e8f599f876d14878358e2d2756de.tar.gz
emacs-5a8a6af88020e8f599f876d14878358e2d2756de.zip
(Selecting Windows): New arg to select-window.
(Selecting Windows): Add with-selected-window. (Size of Window): Add window-inside-edges, etc.
-rw-r--r--lispref/windows.texi67
1 files changed, 53 insertions, 14 deletions
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 7ff3c8e86e3..65e8e82095c 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -401,11 +401,15 @@ This function returns the selected window. This is the window in
401which the cursor appears and to which many commands apply. 401which the cursor appears and to which many commands apply.
402@end defun 402@end defun
403 403
404@defun select-window window 404@defun select-window window &optional norecord
405This function makes @var{window} the selected window. The cursor then 405This function makes @var{window} the selected window. The cursor then
406appears in @var{window} (on redisplay). The buffer being displayed in 406appears in @var{window} (on redisplay). The buffer being displayed in
407@var{window} is immediately designated the current buffer. 407@var{window} is immediately designated the current buffer.
408 408
409Normally @var{window}'s selected buffer is moved to the front of the
410buffer list, but if @var{norecord} is non-@code{nil}, the buffer list
411order is unchanged.
412
409The return value is @var{window}. 413The return value is @var{window}.
410 414
411@example 415@example
@@ -432,6 +436,14 @@ about other frames. If the @var{forms} select some other frame and
432alter the window selected within it, the change persists. 436alter the window selected within it, the change persists.
433@end defmac 437@end defmac
434 438
439@defmac with-selected-window window forms@dots{}
440This macro selects @var{window} (without changing the buffer list),
441executes @var{forms} in sequence, then restores the previously
442selected window (unless that window is no longer alive). It is similar
443to @code{save-selected-window} except that it explicitly selects
444@var{window} and that it does not alter the buffer list sequence.
445@end defmac
446
435@cindex finding windows 447@cindex finding windows
436 The following functions choose one of the windows on the screen, 448 The following functions choose one of the windows on the screen,
437offering various criteria for the choice. 449offering various criteria for the choice.
@@ -1733,28 +1745,42 @@ its right edge value includes the width of the separator line between
1733the window and that neighbor. Since the width of the window does not 1745the window and that neighbor. Since the width of the window does not
1734include this separator, the width does not usually equal the difference 1746include this separator, the width does not usually equal the difference
1735between the right and left edges. 1747between the right and left edges.
1748@end defun
1749
1750@defun window-inside-edges window
1751This is similar to @code{window-edges}, but the edge values
1752it returns include only the text area of the window. They
1753do not include the header line, mode line, scroll bar or
1754vertical separator, fringes, or display margins.
1755@end defun
1736 1756
1737Here is the result obtained on a typical 24-line terminal with just one 1757Here are the results obtained on a typical 24-line terminal with just
1738window: 1758one window, with menu bar enabled:
1739 1759
1740@example 1760@example
1741@group 1761@group
1742(window-edges (selected-window)) 1762(window-edges (selected-window))
1743 @result{} (0 0 80 23) 1763 @result{} (0 1 80 23)
1764@end group
1765@group
1766(window-inside-edges (selected-window))
1767 @result{} (0 1 80 22)
1744@end group 1768@end group
1745@end example 1769@end example
1746 1770
1747@noindent 1771@noindent
1748The bottom edge is at line 23 because the last line is the echo area. 1772The bottom edge is at line 23 because the last line is the echo area.
1749 1773The bottom inside edge is at line 22, which is the window's mode line.
1750If @var{window} is at the upper left corner of its frame, then 1774
1751@var{bottom} is the same as the value of @code{(window-height)}, 1775If @var{window} is at the upper left corner of its frame, and there is
1752@var{right} is almost the same as the value of @code{(window-width)}, 1776no menu bar, then @var{bottom} returned by @code{window-edges} is the
1753and @var{top} and @var{left} are zero. For example, the edges of the 1777same as the value of @code{(window-height)}, @var{right} is almost the
1754following window are @w{@samp{0 0 8 5}}. Assuming that the frame has 1778same as the value of @code{(window-width)}, and @var{top} and
1755more than 8 columns, the last column of the window (column 7) holds a 1779@var{left} are zero. For example, the edges of the following window
1756border rather than text. The last row (row 4) holds the mode line, 1780are @w{@samp{0 0 8 5}}. Assuming that the frame has more than 8
1757shown here with @samp{xxxxxxxxx}. 1781columns, the last column of the window (column 7) holds a border
1782rather than text. The last row (row 4) holds the mode line, shown
1783here with @samp{xxxxxxxxx}.
1758 1784
1759@example 1785@example
1760@group 1786@group
@@ -1772,7 +1798,9 @@ shown here with @samp{xxxxxxxxx}.
1772 1798
1773In the following example, let's suppose that the frame is 7 1799In the following example, let's suppose that the frame is 7
1774columns wide. Then the edges of the left window are @w{@samp{0 0 4 3}} 1800columns wide. Then the edges of the left window are @w{@samp{0 0 4 3}}
1775and the edges of the right window are @w{@samp{4 0 8 3}}. 1801and the edges of the right window are @w{@samp{4 0 7 3}}.
1802The inside edges of the left window are @w{@samp{0 0 3 2}},
1803and the inside edges of the right window are @w{@samp{4 0 7 2}},
1776 1804
1777@example 1805@example
1778@group 1806@group
@@ -1784,6 +1812,17 @@ and the edges of the right window are @w{@samp{4 0 8 3}}.
1784 0 34 7 1812 0 34 7
1785@end group 1813@end group
1786@end example 1814@end example
1815
1816@defun window-pixel-edges window
1817This function is like @code{window-edges} except that, on a graphical
1818display, the edge values are measured in pixels instead of in
1819character lines and columns.
1820@end defun
1821
1822@defun window-inside-pixel-edges window
1823This function is like @code{window-inside-edges} except that, on a
1824graphical display, the edge values are measured in pixels instead of
1825in character lines and columns.
1787@end defun 1826@end defun
1788 1827
1789@node Resizing Windows 1828@node Resizing Windows