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

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

bug#71856: 30.0.50; string-pad length vs width


From: Eli Zaretskii
Subject: bug#71856: 30.0.50; string-pad length vs width
Date: Sat, 06 Jul 2024 11:33:42 +0300

> 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.





reply via email to

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