bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47712: 27.1; Provide `string-display-width` function, which takes pr


From: Lars Ingebrigtsen
Subject: bug#47712: 27.1; Provide `string-display-width` function, which takes properties into account, `substring-width`
Date: Mon, 12 Apr 2021 10:53:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Daniel Mendler <mail@daniel-mendler.de> writes:

> `window-text-pixel-size` computes the size of a portion of the window,
> it does not take a string argument. The function `string-width`
> instead takes a string argument returning the number of columns needed
> to display this string. This function is needed to compute widths of
> strings which are not yet displayed.

If I understand correctly (and I may not), the proposed function just
takes properties into account (like `invisible' and `display'), but does
not compute pixel sizes at all?

I can see how that may be useful in some cases (and is very different
from `window-text-pixel-size'), so I think adding something like that
would be nice.  But the name is confusing -- it sounds like it's
computing the displayed width, and it's not -- if there's images or text
with a different font in there, it's not taken into account?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]