aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorJim Porter2022-08-09 20:09:57 -0700
committerJim Porter2022-08-12 22:07:13 -0700
commitf3408af0a3251a744cb0b55b5e153565bfd57ea3 (patch)
tree7ea273143452b2e2041853c2e8b4c0c73145cce1 /src/coding.c
parent9d4fa4ed4b1f2b081e8ed14cbe16d9ec4b993988 (diff)
downloademacs-f3408af0a3251a744cb0b55b5e153565bfd57ea3.tar.gz
emacs-f3408af0a3251a744cb0b55b5e153565bfd57ea3.zip
Make '$?' and '$$' variables more consistent in Eshell
Previously, '$?' (last exit code) was only useful for external commands, and '$$' (last result) was only useful for Lisp commands. * lisp/eshell/esh-cmd.el (eshell-lisp-form-nil-is-failure): New option. (eshell-lisp-command): Set last exit code to 1 when the command signals an error, and 2 if it returns nil (for Lisp forms only). * lisp/eshell/esh-proc.el (eshell-sentinel): Set last result to t if the command succeeded. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/while-loop-lisp-form, esh-cmd-test/until-loop-lisp-form) (esh-cmd-test/if-else-statement-lisp-form) (esh-cmd-test/if-else-statement-lisp-form-2) (esh-cmd-test/unless-else-statement-lisp-form): New tests. * test/lisp/eshell/esh-var-tests.el (esh-var-test/last-status-var-lisp-command) (esh-var-test/last-status-var-lisp-form) (esh-var-test/last-status-var-lisp-form-2) (esh-var-test/last-status-var-ext-cmd) (esh-var-test/last-status-var-ext-cmd): New tests. (esh-var-test/last-result-var2): Rename from this... ( esh-var-test/last-result-var-twice): ... to this. * doc/misc/eshell.texi (Variables): Update documentation about '$?' and '$$'. (Control Flow): Mention that '(lisp forms)' can be used as conditionals. * etc/NEWS: Announce this change (bug#57129).
Diffstat (limited to 'src/coding.c')
0 files changed, 0 insertions, 0 deletions