[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 9480169 1/2: Change the string-limit parameter semantics
From: |
Stefan Monnier |
Subject: |
Re: master 9480169 1/2: Change the string-limit parameter semantics |
Date: |
Tue, 22 Dec 2020 09:57:26 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> +@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
- Re: master 9480169 1/2: Change the string-limit parameter semantics,
Stefan Monnier <=
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Eli Zaretskii, 2020/12/22
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Lars Ingebrigtsen, 2020/12/23
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Eli Zaretskii, 2020/12/23
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Lars Ingebrigtsen, 2020/12/23
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Lars Ingebrigtsen, 2020/12/23
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Eli Zaretskii, 2020/12/23
- Re: master 9480169 1/2: Change the string-limit parameter semantics, Lars Ingebrigtsen, 2020/12/24