aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-06-06 20:10:37 +0300
committerEli Zaretskii2020-06-06 20:10:37 +0300
commitdd366b5d3bc528b0e3520516f67baa523ffae956 (patch)
treeecaa207da501640a87362ab9ba912e1d04399505
parentfbd49f969eac74a3f34d5505618280ee61be25b7 (diff)
downloademacs-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.texi55
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
2025This function returns the size of the text of @var{window}'s buffer in 2025This function returns the size of the text of @var{window}'s buffer in
2026pixels. @var{window} must be a live window and defaults to the selected 2026pixels. @var{window} must be a live window and defaults to the
2027one. The return value is a cons of the maximum pixel-width of any text 2027selected one. The return value is a cons of the maximum pixel-width
2028line and the maximum pixel-height of all text lines. 2028of any text line and the maximum pixel-height of all text lines. This
2029 2029function exists to allow Lisp programs to adjust the dimensions of
2030The optional argument @var{from}, if non-@code{nil}, specifies the first 2030@var{window} to the buffer text it needs to display.
2031text position to consider and defaults to the minimum accessible 2031
2032position of the buffer. If @var{from} is @code{t}, it uses the minimum 2032The optional argument @var{from}, if non-@code{nil}, specifies the
2033accessible position that is not a newline character. The optional 2033first text position to consider, and defaults to the minimum
2034argument @var{to}, if non-@code{nil}, specifies the last text position 2034accessible position of the buffer. If @var{from} is @code{t}, it
2035to consider and defaults to the maximum accessible position of the 2035stands for the minimum accessible position that is not a newline
2036buffer. If @var{to} is @code{t}, it uses the maximum accessible 2036character. The optional argument @var{to}, if non-@code{nil},
2037position that is not a newline character. 2037specifies the last text position to consider, and defaults to the
2038maximum accessible position of the buffer. If @var{to} is @code{t},
2039it stands for the maximum accessible position that is not a newline
2040character.
2038 2041
2039The optional argument @var{x-limit}, if non-@code{nil}, specifies the 2042The optional argument @var{x-limit}, if non-@code{nil}, specifies the
2040maximum pixel-width that can be returned. @var{x-limit} @code{nil} or 2043maximum X coordinate beyond which text should be ignored; it is
2041omitted, means to use the pixel-width of @var{window}'s body 2044therefore also the largest value of pixel-width that the function can
2042(@pxref{Window Sizes}); this is useful when the caller does not intend 2045return. If @var{x-limit} @code{nil} or omitted, it means to use the
2043to change the width of @var{window}. Otherwise, the caller should 2046pixel-width of @var{window}'s body (@pxref{Window Sizes}); this
2044specify here the maximum width @var{window}'s body may assume. Text 2047default means that text of truncated lines wider than the window will
2045whose x-coordinate is beyond @var{x-limit} is ignored. Since 2048be ignored. This default is useful when the caller does not intend to
2049change the width of @var{window}. Otherwise, the caller should
2050specify here the maximum width @var{window}'s body may assume; in
2051particular, if truncated lines are expected and their text needs to be
2052accounted for, @var{x-limit} should be set to a large value. Since
2046calculating the width of long lines can take some time, it's always a 2053calculating the width of long lines can take some time, it's always a
2047good idea to make this argument as small as needed; in particular, if 2054good idea to make this argument as small as needed; in particular, if
2048the buffer might contain long lines that will be truncated anyway. 2055the buffer might contain long lines that will be truncated anyway.
2049 2056
2050The optional argument @var{y-limit}, if non-@code{nil}, specifies the 2057The optional argument @var{y-limit}, if non-@code{nil}, specifies the
2051maximum pixel-height that can be returned. Text lines whose 2058maximum Y coordinate beyond which text is to be ignored; it is
2052y-coordinate is beyond @var{y-limit} are ignored. Since calculating the 2059therefore also the maximum pixel-height that the function can return.
2053pixel-height of a large buffer can take some time, it makes sense to 2060If @var{y-limit} is nil or omitted, it means to considers all the
2054specify this argument; in particular, if the caller does not know the 2061lines of text till the buffer position specified by @var{to}. Since
2055size of the buffer. 2062calculating the pixel-height of a large buffer can take some time, it
2063makes sense to specify this argument; in particular, if the caller
2064does not know the size of the buffer.
2056 2065
2057The optional argument @var{mode-and-header-line} @code{nil} or omitted 2066The optional argument @var{mode-and-header-line} @code{nil} or omitted
2058means to not include the height of the mode- or header-line of 2067means to not include the height of the mode- or header-line of