From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: master 9480169 1/2: Change the string-limit parameter semantics
Date: Tue, 22 Dec 2020 09:57:26 -0500 [thread overview]
Message-ID: <jwvr1nh51rb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20201222055936.BC7DD20B72@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Tue, 22 Dec 2020 00:59:36 -0500 (EST)")
> +@defun string-limit string length &optional end
> +If @var{string} is shorter than @var{length}, @var{string} is returned
> +as is. Otherwise, return a substring of @var{string} consisting of
> +the first @var{length} characters. If the optional @var{end}
> +parameter is given, return a string of the @var{length} last
> +characters instead.
> @end defun
In my experience it's very rare to need to limit a string to
a particular *length*. Instead you usually want to limit it to
a particular *width*. So I'd strongly recommend you mention
`truncate-string-to-width` as an alternative.
Stefan
next parent reply other threads:[~2020-12-22 14:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201222055934.22358.13749@vcs0.savannah.gnu.org>
[not found] ` <20201222055936.BC7DD20B72@vcs0.savannah.gnu.org>
2020-12-22 14:57 ` Stefan Monnier [this message]
2020-12-22 16:14 ` master 9480169 1/2: Change the string-limit parameter semantics Eli Zaretskii
2020-12-23 6:54 ` Lars Ingebrigtsen
2020-12-23 15:31 ` Eli Zaretskii
2020-12-23 22:25 ` Lars Ingebrigtsen
2020-12-23 22:37 ` Lars Ingebrigtsen
2020-12-24 3:30 ` Eli Zaretskii
2020-12-24 6:02 ` Lars Ingebrigtsen
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=jwvr1nh51rb.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/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.