]> git.eshelyaron.com Git - emacs.git/commit
Eshell variable expansion should always return strings inside quotes
authorJim Porter <jporterbugs@gmail.com>
Tue, 1 Mar 2022 01:38:39 +0000 (17:38 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 3 May 2022 16:22:57 +0000 (18:22 +0200)
commitf7a82699d6e854c2920f7c090fb8df7a3e012a4d
tree49c602db57bad60c4a796d7e1198fb7373670aec
parent316c082d58601119372a0ae6745cba96f3404c86
Eshell variable expansion should always return strings inside quotes

This is closer in behavior to regular shells, and gives Eshell users
greater flexibility in how variables are expanded.

* lisp/eshell/esh-util.el (eshell-convert): Add TO-STRING argument.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Add MODIFIER-P
argument and adjust how 'eshell-convert' and 'eshell-apply-indices'
are called.
(eshell-get-variable, eshell-apply-indices): Add QUOTED argument.

* test/lisp/eshell/esh-var-tests.el (eshell-test-value): New defvar.
(esh-var-test/interp-convert-var-number)
(esh-var-test/interp-convert-var-split-indices)
(esh-var-test/interp-convert-quoted-var-number)
(esh-var-test/interp-convert-quoted-var-split-indices)
(esh-var-test/interp-convert-cmd-string-newline)
(esh-var-test/interp-convert-cmd-multiline)
(esh-var-test/interp-convert-cmd-number)
(esh-var-test/interp-convert-cmd-split-indices)
(esh-var-test/quoted-interp-convert-var-number)
(esh-var-test/quoted-interp-convert-var-split-indices)
(esh-var-test/quoted-interp-convert-quoted-var-number)
(esh-var-test/quoted-interp-convert-quoted-var-split-indices)
(esh-var-test/quoted-interp-convert-cmd-string-newline)
(esh-var-test/quoted-interp-convert-cmd-multiline)
(esh-var-test/quoted-interp-convert-cmd-number)
(esh-var-test/quoted-interp-convert-cmd-split-indices): New tests.

* doc/misc/eshell.texi (Arguments): Expand this section, and document
the new behavior.
(Dollars Expansion): Provide more detail about '$(lisp)' and
'${command}' forms.

* etc/NEWS (Eshell): Announce this change (bug#55236).
doc/misc/eshell.texi
etc/NEWS
lisp/eshell/esh-util.el
lisp/eshell/esh-var.el
test/lisp/eshell/esh-var-tests.el