diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index c9096b0d159..137abe6eb75 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -488,7 +488,7 @@ command hooks should be run before and after the command." (grouped-terms (eshell-prepare-splice terms))) (cond (grouped-terms - `(let ((new-terms (nconc ,@grouped-terms))) + `(let ((new-terms (append ,@grouped-terms))) (,sym (car new-terms) (cdr new-terms)))) ;; If no terms are spliced, use a simpler command form. ((cdr terms) diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 70f6e9c7777..38f90e615a8 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -217,7 +217,8 @@ nil, use FUNCTION instead." "Splice-interpolate list variable." (let ((eshell-test-value '(1 2 3))) (eshell-command-result-equal "echo a $@eshell-test-value z" - '("a" 1 2 3 "z")))) + '("a" 1 2 3 "z")) + (should (equal eshell-test-value '(1 2 3))))) (ert-deftest esh-var-test/interp-var-splice-concat () "Splice-interpolate and concat list variable." @@ -428,7 +429,8 @@ nil, use FUNCTION instead." "Splice-interpolate list variable inside double-quotes." (let ((eshell-test-value '(1 2 3))) (eshell-command-result-equal "echo a \"$@eshell-test-value\" z" - '("a" "1 2 3" "z")))) + '("a" "1 2 3" "z")) + (should (equal eshell-test-value '(1 2 3))))) (ert-deftest esh-var-test/quoted-interp-var-splice-concat () "Splice-interpolate and concat list variable inside double-quotes"