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.
(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) ?\()
"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)))