1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 11:21:04 -08:00
emacs/test/lisp/eshell
Jim Porter f3408af0a3 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).
2022-08-12 22:07:13 -07:00
..
em-alias-tests.el Ensure Eshell variable aliases properly handle indexing 2022-07-12 15:11:00 +02:00
em-basic-tests.el Add tests for Eshell's umask command 2022-03-29 16:50:45 +02:00
em-dirs-tests.el Ensure Eshell variable aliases properly handle indexing 2022-07-12 15:11:00 +02:00
em-extpipe-tests.el When closing an Eshell process target, send EOF three times 2022-06-26 18:27:20 +02:00
em-glob-tests.el Make Eshell globs ending in "/" match directories only 2022-06-26 16:52:38 +02:00
em-hist-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-ls-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-pred-tests.el ; Improve time-convert call in recently changed test 2022-08-07 13:16:53 +02:00
em-script-tests.el Improve tests/organization for built-in variables 2022-07-12 15:10:54 +02:00
em-tramp-tests.el Adapt em-tramp-tests.el 2022-02-06 18:50:16 +01:00
esh-cmd-tests.el Make '$?' and '$$' variables more consistent in Eshell 2022-08-12 22:07:13 -07:00
esh-opt-tests.el Treat "-" as a positional arg in 'eshell-eval-using-options' 2022-01-25 13:28:48 +01:00
esh-proc-tests.el Allow creating processes where only one of stdin or stdout is a PTY 2022-08-05 17:58:54 -07:00
esh-var-tests.el Make '$?' and '$$' variables more consistent in Eshell 2022-08-12 22:07:13 -07:00
eshell-tests-helpers.el Handle escaped characters in Eshell special references (e.g. buffers) 2022-05-01 20:41:23 +02:00
eshell-tests.el Only set Eshell execution result metavariables when non-nil 2022-08-12 22:07:13 -07:00