1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

Partially revert b03f74e0f2

That commit regressed '$<command>' forms in Eshell, due to a
limitation/bug in how 'eshell-do-eval' works.  This fixes
bug#54190.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Quote a lambda.

* test/lisp/eshell/eshell-tests.el (eshell-test/interp-temp-cmd):
New test.
This commit is contained in:
Jim Porter 2022-02-28 09:31:22 -08:00 committed by Eli Zaretskii
parent b8bc359bbf
commit 9e257aecc9
2 changed files with 10 additions and 2 deletions

View File

@ -460,8 +460,12 @@ Possible options are:
(eshell-as-subcommand ,(eshell-parse-command cmd))
(ignore
(nconc eshell-this-command-hook
(list (lambda ()
(delete-file ,temp)))))
;; Quote this lambda; it will be evaluated
;; by `eshell-do-eval', which requires very
;; particular forms in order to work
;; properly. See bug#54190.
(list (function (lambda ()
(delete-file ,temp))))))
(quote ,temp)))
(goto-char (1+ end)))))))
((eq (char-after) ?\()

View File

@ -130,6 +130,10 @@ e.g. \"{(+ 1 2)} 3\" => 3"
"Interpolate Lisp form evaluation"
(should (equal (eshell-test-command-result "+ $(+ 1 2) 3") 6)))
(ert-deftest eshell-test/interp-temp-cmd ()
"Interpolate command result redirected to temp file"
(should (equal (eshell-test-command-result "cat $<echo hi>") "hi")))
(ert-deftest eshell-test/interp-concat ()
"Interpolate and concat command"
(should (equal (eshell-test-command-result "+ ${+ 1 2}3 3") 36)))