aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/eshell/esh-cmd.el12
1 files changed, 4 insertions, 8 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 583ba6ac42f..86e7b83c281 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -575,14 +575,9 @@ must be implemented via rewriting, rather than as a function."
575(defvar eshell-last-command-result) ;Defined in esh-io.el. 575(defvar eshell-last-command-result) ;Defined in esh-io.el.
576 576
577(defun eshell-exit-success-p () 577(defun eshell-exit-success-p ()
578 "Return non-nil if the last command was \"successful\". 578 "Return non-nil if the last command was successful.
579For a bit of Lisp code, this means a return value of non-nil. 579This means an exit code of 0."
580For an external command, it means an exit code of 0." 580 (= eshell-last-command-status 0))
581 (if (save-match-data
582 (string-match "#<\\(Lisp object\\|function .*\\)>"
583 eshell-last-command-name))
584 eshell-last-command-result
585 (= eshell-last-command-status 0)))
586 581
587(defvar eshell--cmd) 582(defvar eshell--cmd)
588 583
@@ -1257,6 +1252,7 @@ represent a lisp form; ARGS will be ignored in that case."
1257 (and result (funcall printer result)) 1252 (and result (funcall printer result))
1258 result) 1253 result)
1259 (error 1254 (error
1255 (setq eshell-last-command-status 1)
1260 (let ((msg (error-message-string err))) 1256 (let ((msg (error-message-string err)))
1261 (if (and (not form-p) 1257 (if (and (not form-p)
1262 (string-match "^Wrong number of arguments" msg) 1258 (string-match "^Wrong number of arguments" msg)