aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJim Porter2022-08-14 13:48:22 -0700
committerJim Porter2022-08-15 20:40:27 -0700
commitcf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6 (patch)
tree5e8c9eb3498242e5f6fe208fdcb6b01dda0f47a4 /lisp
parentc1f1be4b73072440518f02356998cf58ba127ebd (diff)
downloademacs-cf873c1a090b95746cf2f2a9a24a5e4bd7cc2cd6.tar.gz
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')
-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."
607 t)) 607 t))
608 (if (= (length terms) 4) 608 (if (= (length terms) 4)
609 `(eshell-protect 609 `(eshell-protect
610 ,(eshell-invokify-arg (car (last terms)))) t)))) 610 ,(eshell-invokify-arg (car (last terms)) t))))))
611 611
612(defvar eshell-last-command-result) ;Defined in esh-io.el. 612(defvar eshell-last-command-result) ;Defined in esh-io.el.
613 613
@@ -1122,7 +1122,7 @@ be finished later after the completion of an asynchronous subprocess."
1122 (setcar eshell-test-body nil)) 1122 (setcar eshell-test-body nil))
1123 (unless (car eshell-test-body) 1123 (unless (car eshell-test-body)
1124 (setcar eshell-test-body (copy-tree (car args)))) 1124 (setcar eshell-test-body (copy-tree (car args))))
1125 (while (cadr (eshell-do-eval (car eshell-test-body))) 1125 (while (cadr (eshell-do-eval (car eshell-test-body) synchronous-p))
1126 (setcar eshell-command-body 1126 (setcar eshell-command-body
1127 (if (cddr args) 1127 (if (cddr args)
1128 `(progn ,@(copy-tree (cdr args))) 1128 `(progn ,@(copy-tree (cdr args)))
@@ -1142,7 +1142,8 @@ be finished later after the completion of an asynchronous subprocess."
1142 (setcar eshell-test-body (copy-tree (car args)))) 1142 (setcar eshell-test-body (copy-tree (car args))))
1143 (setcar eshell-command-body 1143 (setcar eshell-command-body
1144 (copy-tree 1144 (copy-tree
1145 (if (cadr (eshell-do-eval (car eshell-test-body))) 1145 (if (cadr (eshell-do-eval (car eshell-test-body)
1146 synchronous-p))
1146 (cadr args) 1147 (cadr args)
1147 (car (cddr args))))) 1148 (car (cddr args)))))
1148 (eshell-do-eval (car eshell-command-body) synchronous-p)) 1149 (eshell-do-eval (car eshell-command-body) synchronous-p))