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:
parent
b8bc359bbf
commit
9e257aecc9
@ -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) ?\()
|
||||
|
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user