From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71856: 30.0.50; string-pad length vs width Date: Sat, 06 Jul 2024 11:33:42 +0300 Message-ID: <86zfqu5389.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4886"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71856@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 06 10:34:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sQ0s6-000126-Ft for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jul 2024 10:34:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ0rp-0004Lj-TY; Sat, 06 Jul 2024 04:34:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ0ro-0004LG-Bw for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 04:34:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQ0rn-00019i-Vt for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 04:34:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQ0rq-0006v5-Hp for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 04:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2024 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71856 X-GNU-PR-Package: emacs Original-Received: via spool by 71856-submit@debbugs.gnu.org id=B71856.172025483626580 (code B ref 71856); Sat, 06 Jul 2024 08:34:02 +0000 Original-Received: (at 71856) by debbugs.gnu.org; 6 Jul 2024 08:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:45556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ0rk-0006ue-GR for submit@debbugs.gnu.org; Sat, 06 Jul 2024 04:33:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ0rh-0006uP-Sp for 71856@debbugs.gnu.org; Sat, 06 Jul 2024 04:33:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ0rY-00017w-Ra; Sat, 06 Jul 2024 04:33:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tBO1CI3Km2lSQ0Jtr+dsUVT8oFNGHDf/XLPz8shezEQ=; b=DoVGu/eyQXBT izJZKh4PkhJe+TNXuvTtDgODqYlEan3ppJ6hEp2jqlSmGHIt2YImi0lEdoQNiadpDaY6Dw5K1zuW+ FnCHqUfq0M1cDDTHPlXXlZtMiBI+wJKN11JzyA6/9081qzTYBISjUzz7cxEcqqRFT5u/9JpYmAfux KG4Hd0/3JAUE2iHng8kPmAjkzguHcvZSfsFDc1+YGvvv6Ey199ZlvJkoApm3OQgwza9LCkPPyBraX Q0o6GQXkHDKQ1sYbqWstTklrNVB1G3FisqSZi2zOTcxx2lCRqBsPzrU6qe7Yilk5NccnVbVzxdUme SBDo1mJ+GyYJ6WmavwGwCA==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288476 Archived-At: > 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" > > 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.