diff options
| author | Eli Zaretskii | 2020-06-06 20:10:37 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-06-06 20:10:37 +0300 |
| commit | dd366b5d3bc528b0e3520516f67baa523ffae956 (patch) | |
| tree | ecaa207da501640a87362ab9ba912e1d04399505 | |
| parent | fbd49f969eac74a3f34d5505618280ee61be25b7 (diff) | |
| download | emacs-dd366b5d3bc528b0e3520516f67baa523ffae956.tar.gz emacs-dd366b5d3bc528b0e3520516f67baa523ffae956.zip | |
Improve documentation of 'window-text-pixel-size'
* doc/lispref/display.texi (Size of Displayed Text): Clarify the
description of 'window-text-pixel-size'.
| -rw-r--r-- | doc/lispref/display.texi | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 588e2217b9b..707a1a8dc04 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2023,36 +2023,45 @@ it contains. | |||
| 2023 | 2023 | ||
| 2024 | @defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line | 2024 | @defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line |
| 2025 | This function returns the size of the text of @var{window}'s buffer in | 2025 | This function returns the size of the text of @var{window}'s buffer in |
| 2026 | pixels. @var{window} must be a live window and defaults to the selected | 2026 | pixels. @var{window} must be a live window and defaults to the |
| 2027 | one. The return value is a cons of the maximum pixel-width of any text | 2027 | selected one. The return value is a cons of the maximum pixel-width |
| 2028 | line and the maximum pixel-height of all text lines. | 2028 | of any text line and the maximum pixel-height of all text lines. This |
| 2029 | 2029 | function exists to allow Lisp programs to adjust the dimensions of | |
| 2030 | The optional argument @var{from}, if non-@code{nil}, specifies the first | 2030 | @var{window} to the buffer text it needs to display. |
| 2031 | text position to consider and defaults to the minimum accessible | 2031 | |
| 2032 | position of the buffer. If @var{from} is @code{t}, it uses the minimum | 2032 | The optional argument @var{from}, if non-@code{nil}, specifies the |
| 2033 | accessible position that is not a newline character. The optional | 2033 | first text position to consider, and defaults to the minimum |
| 2034 | argument @var{to}, if non-@code{nil}, specifies the last text position | 2034 | accessible position of the buffer. If @var{from} is @code{t}, it |
| 2035 | to consider and defaults to the maximum accessible position of the | 2035 | stands for the minimum accessible position that is not a newline |
| 2036 | buffer. If @var{to} is @code{t}, it uses the maximum accessible | 2036 | character. The optional argument @var{to}, if non-@code{nil}, |
| 2037 | position that is not a newline character. | 2037 | specifies the last text position to consider, and defaults to the |
| 2038 | maximum accessible position of the buffer. If @var{to} is @code{t}, | ||
| 2039 | it stands for the maximum accessible position that is not a newline | ||
| 2040 | character. | ||
| 2038 | 2041 | ||
| 2039 | The optional argument @var{x-limit}, if non-@code{nil}, specifies the | 2042 | The optional argument @var{x-limit}, if non-@code{nil}, specifies the |
| 2040 | maximum pixel-width that can be returned. @var{x-limit} @code{nil} or | 2043 | maximum X coordinate beyond which text should be ignored; it is |
| 2041 | omitted, means to use the pixel-width of @var{window}'s body | 2044 | therefore also the largest value of pixel-width that the function can |
| 2042 | (@pxref{Window Sizes}); this is useful when the caller does not intend | 2045 | return. If @var{x-limit} @code{nil} or omitted, it means to use the |
| 2043 | to change the width of @var{window}. Otherwise, the caller should | 2046 | pixel-width of @var{window}'s body (@pxref{Window Sizes}); this |
| 2044 | specify here the maximum width @var{window}'s body may assume. Text | 2047 | default means that text of truncated lines wider than the window will |
| 2045 | whose x-coordinate is beyond @var{x-limit} is ignored. Since | 2048 | be ignored. This default is useful when the caller does not intend to |
| 2049 | change the width of @var{window}. Otherwise, the caller should | ||
| 2050 | specify here the maximum width @var{window}'s body may assume; in | ||
| 2051 | particular, if truncated lines are expected and their text needs to be | ||
| 2052 | accounted for, @var{x-limit} should be set to a large value. Since | ||
| 2046 | calculating the width of long lines can take some time, it's always a | 2053 | calculating the width of long lines can take some time, it's always a |
| 2047 | good idea to make this argument as small as needed; in particular, if | 2054 | good idea to make this argument as small as needed; in particular, if |
| 2048 | the buffer might contain long lines that will be truncated anyway. | 2055 | the buffer might contain long lines that will be truncated anyway. |
| 2049 | 2056 | ||
| 2050 | The optional argument @var{y-limit}, if non-@code{nil}, specifies the | 2057 | The optional argument @var{y-limit}, if non-@code{nil}, specifies the |
| 2051 | maximum pixel-height that can be returned. Text lines whose | 2058 | maximum Y coordinate beyond which text is to be ignored; it is |
| 2052 | y-coordinate is beyond @var{y-limit} are ignored. Since calculating the | 2059 | therefore also the maximum pixel-height that the function can return. |
| 2053 | pixel-height of a large buffer can take some time, it makes sense to | 2060 | If @var{y-limit} is nil or omitted, it means to considers all the |
| 2054 | specify this argument; in particular, if the caller does not know the | 2061 | lines of text till the buffer position specified by @var{to}. Since |
| 2055 | size of the buffer. | 2062 | calculating the pixel-height of a large buffer can take some time, it |
| 2063 | makes sense to specify this argument; in particular, if the caller | ||
| 2064 | does not know the size of the buffer. | ||
| 2056 | 2065 | ||
| 2057 | The optional argument @var{mode-and-header-line} @code{nil} or omitted | 2066 | The optional argument @var{mode-and-header-line} @code{nil} or omitted |
| 2058 | means to not include the height of the mode- or header-line of | 2067 | means to not include the height of the mode- or header-line of |