]> git.eshelyaron.com Git - emacs.git/commit
Don't manipulate args in-place for 'eshell-eval-using-options'
authorJim Porter <jporterbugs@gmail.com>
Tue, 25 Jan 2022 05:03:42 +0000 (21:03 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 25 Jan 2022 12:28:45 +0000 (13:28 +0100)
commitdea24a0f7d4ae42fae912dd724a770678054989a
tree17b2ac9faa616b06cb6b3822634dd4f1432c0362
parent115f3f59346595ce01625396c448983a9d17f24c
Don't manipulate args in-place for 'eshell-eval-using-options'

This is necessary for preserve the original arguments to forward on to
:external commands.  Previously, when :preserve-args was also set, the
original argument list could be altered, changing the meaning of the
command.

* lisp/eshell/esh-opt.el (eshell-eval-using-options): Copy MACRO-ARGS
when :preserve-args is set, and pass the original value to
'eshell--do-opts'.
(eshell--do-opts): Use the original arguments when calling an external
command.

* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo): Don't copy the
original arguments, since 'eshell-eval-using-options' does this for
us.

* test/lisp/eshell/esh-opt-tests.el (esh-opt-process-args-test):
Split this test into...
(esh-opt-test/process-args)
(esh-opt-test/process-args-parse-leading-options-only)
(esh-opt-test/process-args-external): ... these.
(test-eshell-eval-using-options): Split this test into...
(esh-opt-test/eval-using-options-short)
(esh-opt-test/eval-using-options-long)
(esh-opt-test/eval-using-options-constant)
(esh-opt-test/eval-using-options-user-specified)
(esh-opt-test/eval-using-options-short-single-token)
(esh-opt-test/eval-using-options-terminate-options)
(esh-opt-test/eval-using-options-parse-leading-options-only)
(esh-opt-test/eval-using-options-unrecognized): ... these.
(esh-opt-test/eval-using-options-external): New test.

* test/lisp/eshell/em-tramp-tests.el: New tests.
lisp/eshell/em-tramp.el
lisp/eshell/esh-opt.el
test/lisp/eshell/em-tramp-tests.el [new file with mode: 0644]
test/lisp/eshell/esh-opt-tests.el