1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Clarify the semantics of 'string-pixel-width'

* doc/lispref/display.texi (Size of Displayed Text):
* lisp/emacs-lisp/subr-x.el (string-pixel-width):
* src/xdisp.c (Fwindow_text_pixel_size, Fbuffer_text_pixel_size):
Doc fixes.  (Bug#73129)
This commit is contained in:
Eli Zaretskii 2024-09-09 14:28:12 +03:00
parent 9f0603207b
commit 03e5698167
3 changed files with 13 additions and 5 deletions

View file

@ -338,7 +338,11 @@ This construct can only be used with lexical binding."
;;;###autoload
(defun string-pixel-width (string)
"Return the width of STRING in pixels."
"Return the width of STRING in pixels.
If you call this function to measure pixel width of a string
with embedded newlines, it returns the width of the widest
substring that does not include newlines."
(declare (important-return-value t))
(if (zerop (length string))
0