summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2001-06-09 05:24:15 +0000
committerJohn Wiegley <johnw@newartisans.com>2001-06-09 05:24:15 +0000
commit74e01d74d6a02f5162b62a8dc723418bfe68df1d (patch)
treea193bc2a6683a1f24fc1f6cd24c9ae58b452d173 /lisp/eshell
parentf6805eb7146089fca03921606a247d28b93c7094 (diff)
downloademacs-74e01d74d6a02f5162b62a8dc723418bfe68df1d.tar.gz
(eshell-exit-success-p): Use a string-match to test if the last
command was Lisp or not. (eshell-rewrite-if-command): "if" syntax is "if A B C", not "if A B x C".
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-cmd.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 7ee97d5debc..88096be13e2 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -613,10 +613,10 @@ must be implemented via rewriting, rather than as a function."
(eshell-invokify-arg (cadr terms) nil t)
(list 'eshell-protect
(eshell-invokify-arg
- (if (= (length terms) 5)
- (car (last terms 3))
+ (if (= (length terms) 4)
+ (car (last terms 2))
(car (last terms))) t))
- (if (= (length terms) 5)
+ (if (= (length terms) 4)
(list 'eshell-protect
(eshell-invokify-arg
(car (last terms)))) t))))
@@ -625,7 +625,9 @@ must be implemented via rewriting, rather than as a function."
"Return non-nil if the last command was \"successful\".
For a bit of Lisp code, this means a return value of non-nil.
For an external command, it means an exit code of 0."
- (if (string= eshell-last-command-name "#<Lisp>")
+ (if (save-match-data
+ (string-match "#<\\(Lisp object\\|function .*\\)>"
+ eshell-last-command-name))
eshell-last-command-result
(= eshell-last-command-status 0)))