1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 22:20:52 -08:00
emacs/test/lisp/eshell
Jim Porter e63ef66c57 Add support for the "splice operator" in Eshell
This allows splicing lists in-place in argument lists, which is
particularly important when defining aliases using the '$*' special
variable (bug#59960).

* lisp/eshell/esh-var.el (eshell-parse-variable): Add support for the
splice operator.
(eshell-interpolate-variable): Let 'eshell-parse-variable' handle
adding 'eshell-escape-arg'.
(eshell-complete-variable-reference): Handle the splice operator.

* lisp/eshell/esh-arg.el (eshell-concat-groups)
(eshell-prepare-splice): New functions...
(eshell-resolve-current-argument): ... use them.
(eshell-splice-args): New function.

* lisp/eshell/esh-cmd.el (eshell-rewrite-named-command): Handle
'eshell-splice-args'.

* lisp/eshell/esh-util.el (eshell-list-to-string): New function...
(eshell-flatten-and-stringify): ... use it.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): Remove
'eshell-splice-args' sigils in Eshell command forms so that we can
perform completion on splice-expansions.

* lisp/eshell/em-unix.el (eshell-complete-host-reference): Don't try
to complete arguments containing "$@".

* test/lisp/eshell/esh-var-tets.el (esh-var-test/interp-list-var)
(esh-var-test/interp-list-var-concat, esh-var-test/interp-var-splice)
(esh-var-test/interp-var-splice-concat)
(esh-var-test/quoted-interp-list-var)
(esh-var-test/quoted-interp-list-var-concat)
(esh-var-test/quoted-interp-var-splice)
(esh-var-test/quoted-interp-var-splice-concat): New tests.

* test/lisp/eshell/em-alias-tests.el
(em-alias-test/alias-all-args-var-splice): New test.

* doc/misc/eshell.texi (Dollars Expansion): Explain the splice
operator.
(Aliases): Expand documentation and use '$@*'.
(Built-ins, Bugs and Ideas): Use '$@*' where appropriate.

* etc/NEWS: Announce this change.
2022-12-15 21:41:03 -08:00
..
em-alias-tests.el Add support for the "splice operator" in Eshell 2022-12-15 21:41:03 -08:00
em-basic-tests.el Add 'eshell-command-result-equal' with an ERT explainer 2022-08-15 20:40:27 -07:00
em-dirs-tests.el Add 'eshell-command-result-equal' with an ERT explainer 2022-08-15 20:40:27 -07:00
em-extpipe-tests.el Provide ERT explainer for 'eshell-match-command-output' 2022-08-15 20:40:27 -07:00
em-glob-tests.el Make Eshell globs ending in "/" match directories only 2022-06-26 16:52:38 +02:00
em-hist-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-ls-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-pred-tests.el ; Improve time-convert call in recently changed test 2022-08-07 13:16:53 +02:00
em-script-tests.el Provide ERT explainer for 'eshell-match-command-output' 2022-08-15 20:40:27 -07:00
em-tramp-tests.el Add the "doas" alias to eshell. 2022-11-05 12:05:05 -07:00
esh-arg-tests.el Treat escaped newlines in Eshell as the empty string 2022-12-07 21:39:07 -08:00
esh-cmd-tests.el Simplify Eshell handle functions and add tests/documentation 2022-09-04 15:15:01 -07:00
esh-ext-tests.el Improve handling of $PATH in Eshell for remote directories 2022-10-17 18:48:52 -07:00
esh-io-tests.el Add support for more kinds of redirect operators in Eshell 2022-09-04 15:15:01 -07:00
esh-opt-tests.el Treat "-" as a positional arg in 'eshell-eval-using-options' 2022-01-25 13:28:48 +01:00
esh-proc-tests.el ; Fix a race condition in an Eshell test 2022-09-08 15:13:17 -07:00
esh-util-tests.el Only strip newlines when stringifying a value for Eshell 2022-11-03 11:44:41 -07:00
esh-var-tests.el Add support for the "splice operator" in Eshell 2022-12-15 21:41:03 -08:00
eshell-tests-helpers.el Improve handling of $PATH in Eshell for remote directories 2022-10-17 18:48:52 -07:00
eshell-tests.el Treat escaped newlines in Eshell as the empty string 2022-12-07 21:39:07 -08:00