GNU bug report logs - #51995
29.0.50; `string-pixel-width' depends on the current window width

Previous Next

Package: emacs;

Reported by: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>

Date: Sat, 20 Nov 2021 05:05:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>
Cc: 51995 <at> debbugs.gnu.org
Subject: bug#51995: 29.0.50; `string-pixel-width' depends on the current window width
Date: Sat, 20 Nov 2021 09:20:51 +0200
> From: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>
> Date: Sat, 20 Nov 2021 02:04:14 -0300
> 
> 
> emacs -Q
> (string-pixel-width "foo")
> => 24
> (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo")
> => 744
> C-x 3 (or reduce the size of the current window some other way)
> (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo")
> => 481
> C-x 3
> (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo")
> => 225
> And so on.  The exact values might vary per system.
> 
> The problem is that, when the string's width is larger than the windows' width,
> the windows' width is returned, and not the string's.

Why is it useful to measure width of a string that is wider than the
window?  Isn't it enough to know that the string is wider than the
window in that case?  (This part is not currently documented, but
documenting it is easy.)  What is the actual real-life situation where
this is needed?




This bug report was last modified 3 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.