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