unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Brahimi Saifullah <brahimi.saifullah@gmail.com>
Cc: 51995@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	[thread overview]
Message-ID: <83o86fthrg.fsf@gnu.org> (raw)
In-Reply-To: <84czmvbepd.fsf@gmail.com> (message from Brahimi Saifullah on Sat, 20 Nov 2021 02:04:14 -0300)

> From: Brahimi Saifullah <brahimi.saifullah@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?





  reply	other threads:[~2021-11-20  7:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20  5:04 bug#51995: 29.0.50; `string-pixel-width' depends on the current window width Brahimi Saifullah
2021-11-20  7:20 ` Eli Zaretskii [this message]
2021-11-20  8:48 ` martin rudalics
2021-11-20  9:35   ` Lars Ingebrigtsen
2021-11-20 21:36 ` Brahimi Saifullah
2021-11-20 21:42 ` Brahimi Saifullah
2021-11-21  6:34   ` Eli Zaretskii
2021-11-21  9:12   ` martin rudalics
2021-11-21 18:38 ` Brahimi Saifullah
2021-11-22  9:28   ` martin rudalics
2021-11-22 11:04     ` Lars Ingebrigtsen
2021-11-22  0:53 ` Brahimi Saifullah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o86fthrg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51995@debbugs.gnu.org \
    --cc=brahimi.saifullah@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).