emacs-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]