[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 87e422f: Beef up the Emacs string utility set a bit
From: |
Lars Ingebrigtsen |
Subject: |
Re: master 87e422f: Beef up the Emacs string utility set a bit |
Date: |
Tue, 22 Dec 2020 15:48:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Mattias Engdegård <mattiase@acm.org> writes:
> Thanks for the good work! I suggest that 'string-limit' be replaced
> with two separate functions, 'string-prefix' and 'string-suffix',
> because these are two different operations and it makes no sense to
> multiplex them onto a single function with an argument saying which
> one we are going to use.
>
> Suggested patch attached. The names can be discussed; for example,
> 'string-left' and 'string-right' would do just as well.
I'm not really enthusiastic about any of these names. When we're
talking about suffixes, we're usually talking about file name suffixes
like ".png", and this has nothing to do with that. These are functions
for limiting the length of a string, and would be called
`string-truncate' if it hadn't been for `string-truncate-left' already
existing and doing something else, and `truncate-string-to-width' doing
something else yet again.
That is, these functions are not for picking out a part of a string, but
for limiting the length, which makes `string-prefix' misleading as for
what the intention is.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: master 87e422f: Beef up the Emacs string utility set a bit, (continued)
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Clément Pit-Claudel, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Lars Ingebrigtsen, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Clément Pit-Claudel, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Lars Ingebrigtsen, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Basil L. Contovounesios, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Lars Ingebrigtsen, 2020/12/21
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Mattias Engdegård, 2020/12/22
- Re: master 87e422f: Beef up the Emacs string utility set a bit,
Lars Ingebrigtsen <=
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Mattias Engdegård, 2020/12/22
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Alfred M. Szmidt, 2020/12/22
Re: master 87e422f: Beef up the Emacs string utility set a bit, Stefan Monnier, 2020/12/21