]> git.eshelyaron.com Git - emacs.git/commit
Use a common set of string delimiters for all Eshell predicates/modifiers
authorJim Porter <jporterbugs@gmail.com>
Mon, 28 Mar 2022 05:28:40 +0000 (22:28 -0700)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 1 May 2022 18:41:18 +0000 (20:41 +0200)
commitade1424a975aabaa208010c6fdd3c8b7c51242ff
treef4c2e874ed3b1f5684f6e72e7f41401b9b3bd22c
parent788694d026b401715330576633a98542623978ff
Use a common set of string delimiters for all Eshell predicates/modifiers

* lisp/eshell/em-pred.el (eshell-pred-delimiter-pairs): New variable.
(eshell-get-comparison-modifier-argument)
(eshell-get-numeric-modifier-argument)
(eshell-get-delimited-modifier-argument): New functions...
(eshell-pred-user-or-group, eshell-pred-file-time)
(eshell-pred-file-links, eshell-pred-file-size)
(eshell-pred-substitute, eshell-join-memebers, eshell-split-members):
... and use them here.
(eshell-include-members): Pass 'mod-char' and use
'eshell-get-delimited-modifier-argument'.
(eshell-pred-file-type, eshell-pred-file-mode): Use 'when-let'.
(eshell-modifier-alist): Pass modifier char to
'eshell-include-members'.

* test/lisp/eshell/em-pred-tests.el
(em-pred-test/predicate-delimiters): New test.
(em-pred-test/predicate-uid, em-pred-test/predicate-gid,
em-pred-test/modifier-include, em-pred-test/modifier-exclude): Remove
cases covered by 'em-pred-test/predicate-delimiters'.
(em-pred-test/modifier-substitute): Add test cases for new delimiter
styles.

* doc/misc/eshell.texi (Argument Predication and Modification):
Explain how string parameters are delimited.
(Argument Modifiers): Document some special delimiter behavior with
the 's/PATTERN/REPLACE/' modifier (bug#55204).

* etc/NEWS: Announce this change, and move the
'eshell-eval-using-options' entry to the Eshell section.
doc/misc/eshell.texi
etc/NEWS
lisp/eshell/em-pred.el
test/lisp/eshell/em-pred-tests.el