* src/xdisp.c (Fwindow_text_pixel_size): Doc fix. (Bug#41737)

This commit is contained in:
Eli Zaretskii 2020-06-06 19:53:08 +03:00
parent d8593fd19f
commit fbd49f969e

View file

@ -10401,33 +10401,43 @@ in_display_vector_p (struct it *it)
DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0, DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0,
doc: /* Return the size of the text of WINDOW's buffer in pixels. doc: /* Return the size of the text of WINDOW's buffer in pixels.
WINDOW must be a live window and defaults to the selected one. The WINDOW must be a live window and defaults to the selected one. The
return value is a cons of the maximum pixel-width of any text line and return value is a cons of the maximum pixel-width of any text line
the maximum pixel-height of all text lines. and the pixel-height of all the text lines in the accessible portion
of buffer text.
This function exists to allow Lisp programs to adjust the dimensions
of WINDOW to the buffer text it needs to display.
The optional argument FROM, if non-nil, specifies the first text The optional argument FROM, if non-nil, specifies the first text
position and defaults to the minimum accessible position of the buffer. position to consider, and defaults to the minimum accessible position
If FROM is t, use the minimum accessible position that starts a of the buffer. If FROM is t, it stands for the minimum accessible
non-empty line. TO, if non-nil, specifies the last text position and position that starts a non-empty line. TO, if non-nil, specifies the
defaults to the maximum accessible position of the buffer. If TO is t, last text position and defaults to the maximum accessible position of
use the maximum accessible position that ends a non-empty line. the buffer. If TO is t, it stands for the maximum accessible position
that ends a non-empty line.
The optional argument X-LIMIT, if non-nil, specifies the maximum text The optional argument X-LIMIT, if non-nil, specifies the maximum X
width that can be returned. X-LIMIT nil or omitted, means to use the coordinate beyond which the text should be ignored. It is therefore
pixel-width of WINDOW's body; use this if you want to know how high also the maximum width that the function can return. X-LIMIT nil or
WINDOW should be become in order to fit all of its buffer's text with omitted means to use the pixel-width of WINDOW's body. This default
the width of WINDOW unaltered. Use the maximum width WINDOW may assume means text of truncated lines wider than the window will be ignored;
if you intend to change WINDOW's width. In any case, text whose specify a large value for X-LIMIT if lines are truncated and you need
x-coordinate is beyond X-LIMIT is ignored. Since calculating the width to account for the truncated text. Use nil for X-LIMIT if you want to
of long lines can take some time, it's always a good idea to make this know how high WINDOW should become in order to fit all of its buffer's
argument as small as possible; in particular, if the buffer contains text with the width of WINDOW unaltered. Use the maximum width WINDOW
long lines that shall be truncated anyway. may assume if you intend to change WINDOW's width. Since calculating
the width of long lines can take some time, it's always a good idea to
make this argument as small as possible; in particular, if the buffer
contains long lines that shall be truncated anyway.
The optional argument Y-LIMIT, if non-nil, specifies the maximum text The optional argument Y-LIMIT, if non-nil, specifies the maximum Y
height (excluding the height of the mode- or header-line, if any) that coordinate beyond which the text is to be ignored; it is therefore
can be returned. Text lines whose y-coordinate is beyond Y-LIMIT are also the maxcomp height that the function can return (excluding the
ignored. Since calculating the text height of a large buffer can take height of the mode- or header-line, if any). Y-LIMIT nil or omitted
some time, it makes sense to specify this argument if the size of the means consider all of the accessible portion of buffer text up to the
buffer is large or unknown. position specified by TO. Since calculating the text height of a
large buffer can take some time, it makes sense to specify this
argument if the size of the buffer is large or unknown.
Optional argument MODE-AND-HEADER-LINE nil or omitted means do not Optional argument MODE-AND-HEADER-LINE nil or omitted means do not
include the height of the mode- or header-line of WINDOW in the return include the height of the mode- or header-line of WINDOW in the return