diff options
| author | Luc Teirlinck | 2004-07-19 21:33:37 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-07-19 21:33:37 +0000 |
| commit | eab4e895a509fd818f252892665b2ce775d439f4 (patch) | |
| tree | dacfb3fce6e5002f82d1d8dd06970e9797d3b3f8 /lispref | |
| parent | f96bad52a42c247ff27af64392d09787a8b1f1fa (diff) | |
| download | emacs-eab4e895a509fd818f252892665b2ce775d439f4.tar.gz emacs-eab4e895a509fd818f252892665b2ce775d439f4.zip | |
Various small changes in addition to:
(Window Point): Mention return value of `set-window-point'.
(Window Start): `pos-visible-in-window-p' disregards horizontal
scrolling. Explain return value if PARTIALLY is non-nil.
(Vertical Scrolling): Mention PIXELS-P argument to `window-vscroll'
and `set-window-vscroll'.
(Size of Window): The argument WINDOW to `window-inside-edges',
`window-pixel-edges' and `window-inside-pixel-edges' is optional.
(Resizing Windows): Explain return value of
`shrink-window-if-larger-than-buffer'.
`window-size-fixed' automatically becomes buffer local when set.
(Window Configurations): Explain return value of `set-window-configuration'.
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/windows.texi | 83 |
1 files changed, 54 insertions, 29 deletions
diff --git a/lispref/windows.texi b/lispref/windows.texi index 92eb6cbc85d..a01dc79d1f1 100644 --- a/lispref/windows.texi +++ b/lispref/windows.texi | |||
| @@ -1195,7 +1195,7 @@ forms. But that value is hard to find. | |||
| 1195 | 1195 | ||
| 1196 | @defun set-window-point window position | 1196 | @defun set-window-point window position |
| 1197 | This function positions point in @var{window} at position | 1197 | This function positions point in @var{window} at position |
| 1198 | @var{position} in @var{window}'s buffer. | 1198 | @var{position} in @var{window}'s buffer. It returns @var{position}. |
| 1199 | @end defun | 1199 | @end defun |
| 1200 | 1200 | ||
| 1201 | @node Window Start | 1201 | @node Window Start |
| @@ -1233,7 +1233,7 @@ window-start position to change in response until after the next | |||
| 1233 | redisplay. | 1233 | redisplay. |
| 1234 | 1234 | ||
| 1235 | For a realistic example of using @code{window-start}, see the | 1235 | For a realistic example of using @code{window-start}, see the |
| 1236 | description of @code{count-lines} in @ref{Text Lines}. | 1236 | description of @code{count-lines}. @xref{Definition of count-lines}. |
| 1237 | @end defun | 1237 | @end defun |
| 1238 | 1238 | ||
| 1239 | @defun window-end &optional window update | 1239 | @defun window-end &optional window update |
| @@ -1324,14 +1324,27 @@ position that works well with point, and thus @var{position} is not used. | |||
| 1324 | @end defun | 1324 | @end defun |
| 1325 | 1325 | ||
| 1326 | @defun pos-visible-in-window-p &optional position window partially | 1326 | @defun pos-visible-in-window-p &optional position window partially |
| 1327 | This function returns @code{t} if @var{position} is within the range of | 1327 | This function returns non-@code{nil} if @var{position} is within the |
| 1328 | text currently visible on the screen in @var{window}. It returns | 1328 | range of text currently visible on the screen in @var{window}. It |
| 1329 | @code{nil} if @var{position} is scrolled vertically or horizontally out | 1329 | returns @code{nil} if @var{position} is scrolled vertically out of |
| 1330 | of view. Locations that are partially obscured are not considered | 1330 | view. Locations that are partially obscured are not considered |
| 1331 | visible unless @var{partially} is non-@code{nil}. The argument | 1331 | visible unless @var{partially} is non-@code{nil}. The argument |
| 1332 | @var{position} defaults to the current position of point in | 1332 | @var{position} defaults to the current position of point in |
| 1333 | @var{window}; @var{window}, to the selected window. | 1333 | @var{window}; @var{window}, to the selected window. |
| 1334 | 1334 | ||
| 1335 | The @code{pos-visible-in-window-p} function considers only vertical | ||
| 1336 | scrolling. If @var{position} is out of view only because @var{window} | ||
| 1337 | has been scrolled horizontally, @code{pos-visible-in-window-p} returns | ||
| 1338 | non-@code{nil} anyway. @xref{Horizontal Scrolling}. | ||
| 1339 | |||
| 1340 | If @var{position} is visible, @code{pos-visible-in-window-p} returns | ||
| 1341 | @code{t} if @var{partially} is @code{nil}; if @var{partially} is | ||
| 1342 | non-@code{nil}, it returns a list of the form @code{(@var{x} @var{y} | ||
| 1343 | @var{fully})}, where @var{x} and @var{y} are the pixel coordinates | ||
| 1344 | relative to the top left corner of the window, and @var{fully} is | ||
| 1345 | @code{t} if the character after @var{position} is fully visible and | ||
| 1346 | @code{nil} otherwise. | ||
| 1347 | |||
| 1335 | Here is an example: | 1348 | Here is an example: |
| 1336 | 1349 | ||
| 1337 | @example | 1350 | @example |
| @@ -1348,7 +1361,7 @@ Here is an example: | |||
| 1348 | @cindex textual scrolling | 1361 | @cindex textual scrolling |
| 1349 | @cindex scrolling textually | 1362 | @cindex scrolling textually |
| 1350 | 1363 | ||
| 1351 | @dfn{Textual scrolling} means moving the text up or down though a | 1364 | @dfn{Textual scrolling} means moving the text up or down through a |
| 1352 | window. It works by changing the value of the window's display-start | 1365 | window. It works by changing the value of the window's display-start |
| 1353 | location. It may also change the value of @code{window-point} to keep | 1366 | location. It may also change the value of @code{window-point} to keep |
| 1354 | point on the screen. | 1367 | point on the screen. |
| @@ -1419,7 +1432,10 @@ When the selected window is the minibuffer, the next window is normally | |||
| 1419 | the one at the top left corner. You can specify a different window to | 1432 | the one at the top left corner. You can specify a different window to |
| 1420 | scroll, when the minibuffer is selected, by setting the variable | 1433 | scroll, when the minibuffer is selected, by setting the variable |
| 1421 | @code{minibuffer-scroll-window}. This variable has no effect when any | 1434 | @code{minibuffer-scroll-window}. This variable has no effect when any |
| 1422 | other window is selected. @xref{Minibuffer Misc}. | 1435 | other window is selected. When it is non-@code{nil} and the |
| 1436 | minibuffer is selected, it takes precedence over | ||
| 1437 | @code{other-window-scroll-buffer}. @xref{Definition of | ||
| 1438 | minibuffer-scroll-window}. | ||
| 1423 | 1439 | ||
| 1424 | When the minibuffer is active, it is the next window if the selected | 1440 | When the minibuffer is active, it is the next window if the selected |
| 1425 | window is the one at the bottom right corner. In this case, | 1441 | window is the one at the bottom right corner. In this case, |
| @@ -1563,10 +1579,11 @@ lines, depends on what the lines contain. A value of .5 could scroll a | |||
| 1563 | line whose height is very short off the screen, while a value of 3.3 | 1579 | line whose height is very short off the screen, while a value of 3.3 |
| 1564 | could scroll just part of the way through a tall line or an image. | 1580 | could scroll just part of the way through a tall line or an image. |
| 1565 | 1581 | ||
| 1566 | @defun window-vscroll &optional window | 1582 | @defun window-vscroll &optional window pixels-p |
| 1567 | This function returns the current vertical scroll position of | 1583 | This function returns the current vertical scroll position of |
| 1568 | @var{window}, If @var{window} is @code{nil}, the selected window is | 1584 | @var{window}. If @var{window} is @code{nil}, the selected window is |
| 1569 | used. | 1585 | used. If @var{pixels-p} is non-@code{nil}, the return value is |
| 1586 | measured in pixels, rather than in units of the normal line height. | ||
| 1570 | 1587 | ||
| 1571 | @example | 1588 | @example |
| 1572 | @group | 1589 | @group |
| @@ -1576,7 +1593,7 @@ used. | |||
| 1576 | @end example | 1593 | @end example |
| 1577 | @end defun | 1594 | @end defun |
| 1578 | 1595 | ||
| 1579 | @defun set-window-vscroll window lines | 1596 | @defun set-window-vscroll window lines &optional pixels-p |
| 1580 | This function sets @var{window}'s vertical scroll position to | 1597 | This function sets @var{window}'s vertical scroll position to |
| 1581 | @var{lines}. The argument @var{lines} should be zero or positive; if | 1598 | @var{lines}. The argument @var{lines} should be zero or positive; if |
| 1582 | not, it is taken as zero. | 1599 | not, it is taken as zero. |
| @@ -1595,6 +1612,9 @@ The return value is the result of this rounding. | |||
| 1595 | @result{} 1.13 | 1612 | @result{} 1.13 |
| 1596 | @end group | 1613 | @end group |
| 1597 | @end example | 1614 | @end example |
| 1615 | |||
| 1616 | If @var{pixels-p} is non-@code{nil}, @var{lines} specifies a number of | ||
| 1617 | pixels. In this case, the return value is @var{lines}. | ||
| 1598 | @end defun | 1618 | @end defun |
| 1599 | 1619 | ||
| 1600 | @node Horizontal Scrolling | 1620 | @node Horizontal Scrolling |
| @@ -1803,15 +1823,16 @@ the frame. The element @var{right} of the value is one more than the | |||
| 1803 | rightmost column used by @var{window}, and @var{bottom} is one more than | 1823 | rightmost column used by @var{window}, and @var{bottom} is one more than |
| 1804 | the bottommost row used by @var{window} and its mode-line. | 1824 | the bottommost row used by @var{window} and its mode-line. |
| 1805 | 1825 | ||
| 1806 | If a window has a scroll bar, the right edge value includes the width of | 1826 | The edges include the space used by the window's scroll bar, display |
| 1807 | the scroll bar. Otherwise, if the window has a neighbor on the right, | 1827 | margins, fringes, header line, and mode line, if it has them. Also, |
| 1808 | its right edge value includes the width of the separator line between | 1828 | if the window has a neighbor on the right, its right edge value |
| 1809 | the window and that neighbor. Since the width of the window does not | 1829 | includes the width of the separator line between the window and that |
| 1810 | include this separator, the width does not usually equal the difference | 1830 | neighbor. Since the width of the window does not include this |
| 1811 | between the right and left edges. | 1831 | separator, the width does not usually equal the difference between the |
| 1832 | right and left edges. | ||
| 1812 | @end defun | 1833 | @end defun |
| 1813 | 1834 | ||
| 1814 | @defun window-inside-edges window | 1835 | @defun window-inside-edges &optional window |
| 1815 | This is similar to @code{window-edges}, but the edge values | 1836 | This is similar to @code{window-edges}, but the edge values |
| 1816 | it returns include only the text area of the window. They | 1837 | it returns include only the text area of the window. They |
| 1817 | do not include the header line, mode line, scroll bar or | 1838 | do not include the header line, mode line, scroll bar or |
| @@ -1877,13 +1898,13 @@ and the inside edges of the right window are @w{@samp{4 0 7 2}}, | |||
| 1877 | @end group | 1898 | @end group |
| 1878 | @end example | 1899 | @end example |
| 1879 | 1900 | ||
| 1880 | @defun window-pixel-edges window | 1901 | @defun window-pixel-edges &optional window |
| 1881 | This function is like @code{window-edges} except that, on a graphical | 1902 | This function is like @code{window-edges} except that, on a graphical |
| 1882 | display, the edge values are measured in pixels instead of in | 1903 | display, the edge values are measured in pixels instead of in |
| 1883 | character lines and columns. | 1904 | character lines and columns. |
| 1884 | @end defun | 1905 | @end defun |
| 1885 | 1906 | ||
| 1886 | @defun window-inside-pixel-edges window | 1907 | @defun window-inside-pixel-edges &optional window |
| 1887 | This function is like @code{window-inside-edges} except that, on a | 1908 | This function is like @code{window-inside-edges} except that, on a |
| 1888 | graphical display, the edge values are measured in pixels instead of | 1909 | graphical display, the edge values are measured in pixels instead of |
| 1889 | in character lines and columns. | 1910 | in character lines and columns. |
| @@ -1975,6 +1996,9 @@ However, the command does nothing if the window is already too small to | |||
| 1975 | display the whole text of the buffer, or if part of the contents are | 1996 | display the whole text of the buffer, or if part of the contents are |
| 1976 | currently scrolled off screen, or if the window is not the full width of | 1997 | currently scrolled off screen, or if the window is not the full width of |
| 1977 | its frame, or if the window is the only window in its frame. | 1998 | its frame, or if the window is the only window in its frame. |
| 1999 | |||
| 2000 | This command returns non-@code{nil} if it actually shrank the window | ||
| 2001 | and @code{nil} otherwise. | ||
| 1978 | @end deffn | 2002 | @end deffn |
| 1979 | 2003 | ||
| 1980 | @tindex window-size-fixed | 2004 | @tindex window-size-fixed |
| @@ -1988,9 +2012,7 @@ If the value is @code{height}, then only the window's height is fixed; | |||
| 1988 | if the value is @code{width}, then only the window's width is fixed. | 2012 | if the value is @code{width}, then only the window's width is fixed. |
| 1989 | Any other non-@code{nil} value fixes both the width and the height. | 2013 | Any other non-@code{nil} value fixes both the width and the height. |
| 1990 | 2014 | ||
| 1991 | The usual way to use this variable is to give it a buffer-local value in | 2015 | This variable automatically becomes buffer-local when set. |
| 1992 | a particular buffer. That way, the windows (but usually there is only | ||
| 1993 | one) displaying that buffer have fixed size. | ||
| 1994 | 2016 | ||
| 1995 | Explicit size-change functions such as @code{enlarge-window} | 2017 | Explicit size-change functions such as @code{enlarge-window} |
| 1996 | get an error if they would have to change a window size which is fixed. | 2018 | get an error if they would have to change a window size which is fixed. |
| @@ -2132,7 +2154,8 @@ old one. | |||
| 2132 | 2154 | ||
| 2133 | If the frame which @var{configuration} was saved from is dead, all this | 2155 | If the frame which @var{configuration} was saved from is dead, all this |
| 2134 | function does is restore the three variables @code{window-min-height}, | 2156 | function does is restore the three variables @code{window-min-height}, |
| 2135 | @code{window-min-width} and @code{minibuffer-scroll-window}. | 2157 | @code{window-min-width} and @code{minibuffer-scroll-window}. In this |
| 2158 | case, the function returns @code{nil}. Otherwise, it returns @code{t}. | ||
| 2136 | 2159 | ||
| 2137 | Here is a way of using this function to get the same effect | 2160 | Here is a way of using this function to get the same effect |
| 2138 | as @code{save-window-excursion}: | 2161 | as @code{save-window-excursion}: |
| @@ -2151,10 +2174,11 @@ as @code{save-window-excursion}: | |||
| 2151 | @defspec save-window-excursion forms@dots{} | 2174 | @defspec save-window-excursion forms@dots{} |
| 2152 | This special form records the window configuration, executes @var{forms} | 2175 | This special form records the window configuration, executes @var{forms} |
| 2153 | in sequence, then restores the earlier window configuration. The window | 2176 | in sequence, then restores the earlier window configuration. The window |
| 2154 | configuration includes the value of point and the portion of the buffer | 2177 | configuration includes, for each window, the value of point and the |
| 2155 | that is visible. It also includes the choice of selected window. | 2178 | portion of the buffer that is visible. It also includes the choice of |
| 2156 | However, it does not include the value of point in the current buffer; | 2179 | selected window. However, it does not include the value of point in |
| 2157 | use @code{save-excursion} also, if you wish to preserve that. | 2180 | the current buffer; use @code{save-excursion} also, if you wish to |
| 2181 | preserve that. | ||
| 2158 | 2182 | ||
| 2159 | Don't use this construct when @code{save-selected-window} is sufficient. | 2183 | Don't use this construct when @code{save-selected-window} is sufficient. |
| 2160 | 2184 | ||
| @@ -2275,6 +2299,7 @@ This function sets @var{window}'s end trigger position at | |||
| 2275 | 2299 | ||
| 2276 | @defun window-redisplay-end-trigger &optional window | 2300 | @defun window-redisplay-end-trigger &optional window |
| 2277 | This function returns @var{window}'s current end trigger position. | 2301 | This function returns @var{window}'s current end trigger position. |
| 2302 | If @var{window} is @code{nil} or omitted, it uses the selected window. | ||
| 2278 | @end defun | 2303 | @end defun |
| 2279 | 2304 | ||
| 2280 | @defvar window-configuration-change-hook | 2305 | @defvar window-configuration-change-hook |