diff options
| author | Richard M. Stallman | 2003-07-14 16:04:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-07-14 16:04:44 +0000 |
| commit | 5a8a6af88020e8f599f876d14878358e2d2756de (patch) | |
| tree | e79d40692087b451afcc0d8e0929575dee0016d3 | |
| parent | e73c3ec468a3e3ab6a521dee6b053f74d03c0d08 (diff) | |
| download | emacs-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.texi | 67 |
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 | |||
| 401 | which the cursor appears and to which many commands apply. | 401 | which 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 |
| 405 | This function makes @var{window} the selected window. The cursor then | 405 | This function makes @var{window} the selected window. The cursor then |
| 406 | appears in @var{window} (on redisplay). The buffer being displayed in | 406 | appears 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 | ||
| 409 | Normally @var{window}'s selected buffer is moved to the front of the | ||
| 410 | buffer list, but if @var{norecord} is non-@code{nil}, the buffer list | ||
| 411 | order is unchanged. | ||
| 412 | |||
| 409 | The return value is @var{window}. | 413 | The 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 | |||
| 432 | alter the window selected within it, the change persists. | 436 | alter the window selected within it, the change persists. |
| 433 | @end defmac | 437 | @end defmac |
| 434 | 438 | ||
| 439 | @defmac with-selected-window window forms@dots{} | ||
| 440 | This macro selects @var{window} (without changing the buffer list), | ||
| 441 | executes @var{forms} in sequence, then restores the previously | ||
| 442 | selected window (unless that window is no longer alive). It is similar | ||
| 443 | to @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, |
| 437 | offering various criteria for the choice. | 449 | offering various criteria for the choice. |
| @@ -1733,28 +1745,42 @@ its right edge value includes the width of the separator line between | |||
| 1733 | the window and that neighbor. Since the width of the window does not | 1745 | the window and that neighbor. Since the width of the window does not |
| 1734 | include this separator, the width does not usually equal the difference | 1746 | include this separator, the width does not usually equal the difference |
| 1735 | between the right and left edges. | 1747 | between the right and left edges. |
| 1748 | @end defun | ||
| 1749 | |||
| 1750 | @defun window-inside-edges window | ||
| 1751 | This is similar to @code{window-edges}, but the edge values | ||
| 1752 | it returns include only the text area of the window. They | ||
| 1753 | do not include the header line, mode line, scroll bar or | ||
| 1754 | vertical separator, fringes, or display margins. | ||
| 1755 | @end defun | ||
| 1736 | 1756 | ||
| 1737 | Here is the result obtained on a typical 24-line terminal with just one | 1757 | Here are the results obtained on a typical 24-line terminal with just |
| 1738 | window: | 1758 | one 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 |
| 1748 | The bottom edge is at line 23 because the last line is the echo area. | 1772 | The bottom edge is at line 23 because the last line is the echo area. |
| 1749 | 1773 | The bottom inside edge is at line 22, which is the window's mode line. | |
| 1750 | If @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)}, | 1775 | If @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)}, | 1776 | no menu bar, then @var{bottom} returned by @code{window-edges} is the |
| 1753 | and @var{top} and @var{left} are zero. For example, the edges of the | 1777 | same as the value of @code{(window-height)}, @var{right} is almost the |
| 1754 | following window are @w{@samp{0 0 8 5}}. Assuming that the frame has | 1778 | same as the value of @code{(window-width)}, and @var{top} and |
| 1755 | more 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 |
| 1756 | border rather than text. The last row (row 4) holds the mode line, | 1780 | are @w{@samp{0 0 8 5}}. Assuming that the frame has more than 8 |
| 1757 | shown here with @samp{xxxxxxxxx}. | 1781 | columns, the last column of the window (column 7) holds a border |
| 1782 | rather than text. The last row (row 4) holds the mode line, shown | ||
| 1783 | here with @samp{xxxxxxxxx}. | ||
| 1758 | 1784 | ||
| 1759 | @example | 1785 | @example |
| 1760 | @group | 1786 | @group |
| @@ -1772,7 +1798,9 @@ shown here with @samp{xxxxxxxxx}. | |||
| 1772 | 1798 | ||
| 1773 | In the following example, let's suppose that the frame is 7 | 1799 | In the following example, let's suppose that the frame is 7 |
| 1774 | columns wide. Then the edges of the left window are @w{@samp{0 0 4 3}} | 1800 | columns wide. Then the edges of the left window are @w{@samp{0 0 4 3}} |
| 1775 | and the edges of the right window are @w{@samp{4 0 8 3}}. | 1801 | and the edges of the right window are @w{@samp{4 0 7 3}}. |
| 1802 | The inside edges of the left window are @w{@samp{0 0 3 2}}, | ||
| 1803 | and 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 | ||
| 1817 | This function is like @code{window-edges} except that, on a graphical | ||
| 1818 | display, the edge values are measured in pixels instead of in | ||
| 1819 | character lines and columns. | ||
| 1820 | @end defun | ||
| 1821 | |||
| 1822 | @defun window-inside-pixel-edges window | ||
| 1823 | This function is like @code{window-inside-edges} except that, on a | ||
| 1824 | graphical display, the edge values are measured in pixels instead of | ||
| 1825 | in character lines and columns. | ||
| 1787 | @end defun | 1826 | @end defun |
| 1788 | 1827 | ||
| 1789 | @node Resizing Windows | 1828 | @node Resizing Windows |