From: Eli Zaretskii <eliz@gnu.org>
To: Adam Porter <adam@alphapapa.net>
Cc: 69822@debbugs.gnu.org
Subject: bug#69822: [PATCH] format-spec pads when it should only truncate
Date: Sat, 16 Mar 2024 12:22:26 +0200 [thread overview]
Message-ID: <86bk7e79y5.fsf@gnu.org> (raw)
In-Reply-To: <cc0e3544-d0df-405b-8646-1159a21d9274@alphapapa.net> (message from Adam Porter on Fri, 15 Mar 2024 21:28:15 -0500)
> Date: Fri, 15 Mar 2024 21:28:15 -0500
> From: Adam Porter <adam@alphapapa.net>
>
> Please see the attached patch which fixes a bug in `format-spec': that a
> format spec like "%>15t", which is intended to limit the width of a
> string to 15 characters, would also pad a string less than that length
> to be that length.
I don't understand why you consider it a bug. According to the doc
string (see below), this:
(format-spec "%>15t" '((?t . "0123456789")))
should behave the same as this:
(format "%15s" "0123456789")
And in my testing, it does: both produce " 0123456789".
So I don't think I agree that there's a bug here to begin with. The
doc string of format-spec says:
The width and truncation modifiers behave like the corresponding
ones in ‘format’ when applied to %s.
next prev parent reply other threads:[~2024-03-16 10:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 2:28 bug#69822: [PATCH] format-spec pads when it should only truncate Adam Porter
2024-03-16 10:22 ` Eli Zaretskii [this message]
2024-03-17 4:12 ` Adam Porter
2024-03-17 6:23 ` Eli Zaretskii
2024-03-17 12:11 ` Basil L. Contovounesios
2024-03-18 1:16 ` Adam Porter
2024-03-21 9:52 ` Basil L. Contovounesios
2024-03-21 10:47 ` Adam Porter
2024-03-21 11:03 ` Basil L. Contovounesios
2024-03-23 13:59 ` Adam Porter
2024-03-16 10:35 ` Basil L. Contovounesios
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=86bk7e79y5.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=69822@debbugs.gnu.org \
--cc=adam@alphapapa.net \
/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).