summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-08-14 13:48:22 -0700
committerJim Porter <jporterbugs@gmail.com>2022-08-15 20:40:27 -0700
commitcf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6 (patch)
tree5e8c9eb3498242e5f6fe208fdcb6b01dda0f47a4 /lisp/eshell
parentc1f1be4b73072440518f02356998cf58ba127ebd (diff)
downloademacs-cf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6.tar.gz
emacs-cf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6.tar.bz2
emacs-cf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6.zip
Fix non-interactive use of conditionals in Eshell
* lisp/eshell/esh-cmd.el (eshell-rewrite-if-command): Fix misplaced 't' symbol; it should be passed to 'eshell-invokify-arg'. (eshell-do-eval): Pass 'synchronous-p' to recursive calls in some missing cases. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/if-statement, (esh-cmd-test/if-else-statement) (esh-cmd-test/if-else-statement-lisp-form) (esh-cmd-test/if-else-statement-lisp-form-2) (esh-cmd-test/if-else-statement-ext-cmd) (esh-cmd-test/unless-statement) (esh-cmd-test/unless-else-statement) (esh-cmd-test/unless-else-statement-lisp-form) (esh-cmd-test/unless-else-statement-ext-cmd): Use 'eshell-command-result-equal'.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-cmd.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 62c95056fd2..2f77f3f4974 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -607,7 +607,7 @@ must be implemented via rewriting, rather than as a function."
t))
(if (= (length terms) 4)
`(eshell-protect
- ,(eshell-invokify-arg (car (last terms)))) t))))
+ ,(eshell-invokify-arg (car (last terms)) t))))))
(defvar eshell-last-command-result) ;Defined in esh-io.el.
@@ -1122,7 +1122,7 @@ be finished later after the completion of an asynchronous subprocess."
(setcar eshell-test-body nil))
(unless (car eshell-test-body)
(setcar eshell-test-body (copy-tree (car args))))
- (while (cadr (eshell-do-eval (car eshell-test-body)))
+ (while (cadr (eshell-do-eval (car eshell-test-body) synchronous-p))
(setcar eshell-command-body
(if (cddr args)
`(progn ,@(copy-tree (cdr args)))
@@ -1142,7 +1142,8 @@ be finished later after the completion of an asynchronous subprocess."
(setcar eshell-test-body (copy-tree (car args))))
(setcar eshell-command-body
(copy-tree
- (if (cadr (eshell-do-eval (car eshell-test-body)))
+ (if (cadr (eshell-do-eval (car eshell-test-body)
+ synchronous-p))
(cadr args)
(car (cddr args)))))
(eshell-do-eval (car eshell-command-body) synchronous-p))