]> git.eshelyaron.com Git - emacs.git/commit
Improve evaluation of conditional Eshell forms
authorJim Porter <jporterbugs@gmail.com>
Fri, 1 Nov 2024 17:40:25 +0000 (10:40 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 2 Nov 2024 07:03:16 +0000 (08:03 +0100)
commit84372672e3946ca0ea1a0ef05e84760a357dedd1
treea0925a5c96ed4a33e3b13219c44621f4b586f6a4
parentda362a947b300046f601051f332ae4a1f480061e
Improve evaluation of conditional Eshell forms

This simplifies the logic for building these forms and also fixes an
issue where a subcommand in a "&&" or "||" conditional had its output
suppressed.

* lisp/eshell/esh-cmd.el (eshell-structure-basic-command): Make
obsolete.
(eshell-silence-test-command): New function...
(eshell-rewrite-while-command, eshell-rewrite-if-command): ... use it,
and make the command form ourselves.
(eshell-parse-pipeline): Use 'and' and 'or' to make the conditional
command sequence.
(eshell-command-success): New macro.
(eshell-do-eval): Add support for 'and' and 'or' forms.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/and-operator/output)
(esh-cmd-test/or-operator/output): New tests.

(cherry picked from commit 673c906a5b7255987c09f534de45e555fc7fc9ae)
lisp/eshell/esh-cmd.el
test/lisp/eshell/esh-cmd-tests.el