# HG changeset patch # User John Wiegley # Date 992064255 0 # Node ID fa54203d014a10bc903bbcb2c5cdbbb50d66ac1d # Parent 13be8065f0cad08cff27f635e8a0ac6c235f0b62 (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". diff -r 13be8065f0ca -r fa54203d014a lisp/eshell/esh-cmd.el --- a/lisp/eshell/esh-cmd.el Sat Jun 09 05:23:38 2001 +0000 +++ b/lisp/eshell/esh-cmd.el Sat Jun 09 05:24:15 2001 +0000 @@ -613,10 +613,10 @@ (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 @@ "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 "#") + (if (save-match-data + (string-match "#<\\(Lisp object\\|function .*\\)>" + eshell-last-command-name)) eshell-last-command-result (= eshell-last-command-status 0)))