From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 71856@debbugs.gnu.org
Subject: bug#71856: 30.0.50; string-pad length vs width
Date: Sat, 06 Jul 2024 11:33:42 +0300 [thread overview]
Message-ID: <86zfqu5389.fsf@gnu.org> (raw)
In-Reply-To: <jwv34ouqwk3.fsf-monnier+@gnu.org> (bug-gnu-emacs@gnu.org)
> Cc: monnier@iro.umontreal.ca
> Date: Sun, 30 Jun 2024 11:37:41 -0400
> From: Stefan Monnier via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Is it just we or we should `s/length/width/` on the doc&code of
> `string-pad`? AFAIK counting codepoints rarely makes sense (unless
> those code points have width==1, of course).
Probably. But the issue is not just with width==1, it is also with
character compositions. Patches using string-width instead of length
are welcome.
There's another issue here: string-width ignores some of the
display-related issues, so we should consider whether we should use
string-width or string-pixel-width here (or maybe have optional
behavior, controlled by the caller, to use either one, as each one has
its advantages and disadvantages).
> Same for `string-fill`.
No, this one uses fill-region, which already handles the width of
characters. So I've now fixed the doc string and renamed the argument
to WIDTH on the emacs-30 branch.
prev parent reply other threads:[~2024-07-06 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-30 15:37 bug#71856: 30.0.50; string-pad length vs width Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-03 1:29 ` Stefan Kangas
2024-07-03 1:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-06 8:33 ` Eli Zaretskii [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86zfqu5389.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=71856@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.