[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: |
Mattias Engdegård |
Subject: |
Re: master 87e422f: Beef up the Emacs string utility set a bit |
Date: |
Tue, 22 Dec 2020 11:41:01 +0100 |
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.
If someone prefers saturating semantics for negative length arguments, then
that's an option too. Ie, in case we want
(string-prefix "abc" -2)
to yield the empty string instead of an error. I think an error is more useful.
The new functions are now inline (defsubst) in keeping with the spirit of
subr-x.el. (We really should inline these better!)
0001-Replace-string-limit-with-string-prefix-and-string-s.patch
Description: Binary data
- 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 <=
- Re: master 87e422f: Beef up the Emacs string utility set a bit, Lars Ingebrigtsen, 2020/12/22
- 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