emacs/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.el Only set Eshell execution result metavariables when non-nil 2022-08-12 22:07:13 -07:00
em-banner.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-basic.el Don't use 'eshell-convert' when all we want is a number 2022-03-29 16:50:48 +02:00
em-cmpl.el Remove many items obsolete since 24.1 2022-07-08 14:10:38 +02:00
em-dirs.el Ensure Eshell variable aliases properly handle indexing 2022-07-12 15:11:00 +02:00
em-elecslash.el New electric forward slash Eshell module 2022-04-21 11:57:12 -07:00
em-extpipe.el Rename recently added macro to follow conventions 2022-08-04 12:18:46 +02:00
em-glob.el Make Eshell globs ending in "/" match directories only 2022-06-26 16:52:38 +02:00
em-hist.el Autoload string-blank-p 2022-08-09 21:58:00 +02:00
em-ls.el Account for remapped faces in $COLUMNS and $LINES in Eshell 2022-06-09 10:08:15 +03:00
em-pred.el Optionally signal an error if an Eshell predicate fails to match anything 2022-06-26 16:51:21 +02:00
em-prompt.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-rebind.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
em-script.el Don't use 'eshell-eval-using-options' for 'eshell/source' or 'eshell/.' 2022-01-21 13:06:34 +01:00
em-smart.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-term.el * lisp/eshell/em-term.el (eshell-visual-commands): Add vim. 2022-06-30 15:03:46 +02:00
em-tramp.el Make usage of su and sudo consistent in eshell (bug#53783) 2022-02-06 09:43:13 +01:00
em-unix.el Rename nil-blank-string to eshell-nil-blank-string 2022-08-04 09:55:13 +02:00
em-xtra.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
esh-arg.el Fix quoting of #' in some doc strings 2022-08-03 13:14:32 +02:00
esh-cmd.el Make '$?' and '$$' variables more consistent in Eshell 2022-08-12 22:07:13 -07:00
esh-ext.el Fix eshell-explicit-command-char doc string typo 2022-03-25 19:02:04 +01:00
esh-io.el Only set Eshell execution result metavariables when non-nil 2022-08-12 22:07:13 -07:00
esh-mode.el Make some defcustom types more restrictive 2022-07-05 18:33:29 +02:00
esh-module.el Add Eshell syntax to more easily bypass Eshell's own pipelining 2022-01-24 21:46:31 +01:00
esh-opt.el ; Fix typos 2022-05-15 11:15:06 +02:00
esh-proc.el Make '$?' and '$$' variables more consistent in Eshell 2022-08-12 22:07:13 -07:00
esh-util.el ; Unconditionally require built-in libraries 2022-08-08 18:18:50 +02:00
esh-var.el Update eshell-variable-aliases-list defcustom type 2022-07-16 14:05:44 +02:00
eshell.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00