aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-06-06 19:53:08 +0300
committerEli Zaretskii2020-06-06 19:53:08 +0300
commitfbd49f969eac74a3f34d5505618280ee61be25b7 (patch)
tree93b313d5636d551fec2c4b347c7b854895c0f7dd
parentd8593fd19ffdb1fa62f0b0c4b971cfdb325fbe1d (diff)
downloademacs-fbd49f969eac74a3f34d5505618280ee61be25b7.tar.gz
emacs-fbd49f969eac74a3f34d5505618280ee61be25b7.zip
* src/xdisp.c (Fwindow_text_pixel_size): Doc fix. (Bug#41737)
-rw-r--r--src/xdisp.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 684b4679d81..a280b48de99 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10401,33 +10401,43 @@ in_display_vector_p (struct it *it)
10401DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0, 10401DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0,
10402 doc: /* Return the size of the text of WINDOW's buffer in pixels. 10402 doc: /* Return the size of the text of WINDOW's buffer in pixels.
10403WINDOW must be a live window and defaults to the selected one. The 10403WINDOW must be a live window and defaults to the selected one. The
10404return value is a cons of the maximum pixel-width of any text line and 10404return value is a cons of the maximum pixel-width of any text line
10405the maximum pixel-height of all text lines. 10405and the pixel-height of all the text lines in the accessible portion
10406of buffer text.
10407
10408This function exists to allow Lisp programs to adjust the dimensions
10409of WINDOW to the buffer text it needs to display.
10406 10410
10407The optional argument FROM, if non-nil, specifies the first text 10411The optional argument FROM, if non-nil, specifies the first text
10408position and defaults to the minimum accessible position of the buffer. 10412position to consider, and defaults to the minimum accessible position
10409If FROM is t, use the minimum accessible position that starts a 10413of the buffer. If FROM is t, it stands for the minimum accessible
10410non-empty line. TO, if non-nil, specifies the last text position and 10414position that starts a non-empty line. TO, if non-nil, specifies the
10411defaults to the maximum accessible position of the buffer. If TO is t, 10415last text position and defaults to the maximum accessible position of
10412use the maximum accessible position that ends a non-empty line. 10416the buffer. If TO is t, it stands for the maximum accessible position
10413 10417that ends a non-empty line.
10414The optional argument X-LIMIT, if non-nil, specifies the maximum text 10418
10415width that can be returned. X-LIMIT nil or omitted, means to use the 10419The optional argument X-LIMIT, if non-nil, specifies the maximum X
10416pixel-width of WINDOW's body; use this if you want to know how high 10420coordinate beyond which the text should be ignored. It is therefore
10417WINDOW should be become in order to fit all of its buffer's text with 10421also the maximum width that the function can return. X-LIMIT nil or
10418the width of WINDOW unaltered. Use the maximum width WINDOW may assume 10422omitted means to use the pixel-width of WINDOW's body. This default
10419if you intend to change WINDOW's width. In any case, text whose 10423means text of truncated lines wider than the window will be ignored;
10420x-coordinate is beyond X-LIMIT is ignored. Since calculating the width 10424specify a large value for X-LIMIT if lines are truncated and you need
10421of long lines can take some time, it's always a good idea to make this 10425to account for the truncated text. Use nil for X-LIMIT if you want to
10422argument as small as possible; in particular, if the buffer contains 10426know how high WINDOW should become in order to fit all of its buffer's
10423long lines that shall be truncated anyway. 10427text with the width of WINDOW unaltered. Use the maximum width WINDOW
10424 10428may assume if you intend to change WINDOW's width. Since calculating
10425The optional argument Y-LIMIT, if non-nil, specifies the maximum text 10429the width of long lines can take some time, it's always a good idea to
10426height (excluding the height of the mode- or header-line, if any) that 10430make this argument as small as possible; in particular, if the buffer
10427can be returned. Text lines whose y-coordinate is beyond Y-LIMIT are 10431contains long lines that shall be truncated anyway.
10428ignored. Since calculating the text height of a large buffer can take 10432
10429some time, it makes sense to specify this argument if the size of the 10433The optional argument Y-LIMIT, if non-nil, specifies the maximum Y
10430buffer is large or unknown. 10434coordinate beyond which the text is to be ignored; it is therefore
10435also the maxcomp height that the function can return (excluding the
10436height of the mode- or header-line, if any). Y-LIMIT nil or omitted
10437means consider all of the accessible portion of buffer text up to the
10438position specified by TO. Since calculating the text height of a
10439large buffer can take some time, it makes sense to specify this
10440argument if the size of the buffer is large or unknown.
10431 10441
10432Optional argument MODE-AND-HEADER-LINE nil or omitted means do not 10442Optional argument MODE-AND-HEADER-LINE nil or omitted means do not
10433include the height of the mode- or header-line of WINDOW in the return 10443include the height of the mode- or header-line of WINDOW in the return