]> git.eshelyaron.com Git - emacs.git/commit
Improve handling of deferrable Eshell commands
authorJim Porter <jporterbugs@gmail.com>
Wed, 17 Jul 2024 05:07:33 +0000 (22:07 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Jul 2024 10:31:53 +0000 (12:31 +0200)
commit91ef3f905742a450b2aed7491fc55a5ca84013da
tree39f93c3e7b459ef80d56214c82ff83a542ada6a6
parentefffc5c00085d169601e9107f2a5dd504f8e8741
Improve handling of deferrable Eshell commands

Now, we use the 'eshell-deferrable' wrapper to wrap a form that returns
a process (or list thereof).  This improves upon the old method, which
failed to handle 'eshell-replace-command' correctly.  In that case,
Eshell would fail to unmark commands as deferrable when necessary
(e.g. for commands in pipelines).

* lisp/eshell/esh-cmd.el (eshell-deferrable-commands): Make into a
defvar.
(eshell-deferrable): New function...
(eshell-structure-basic-command): ... use it.
(eshell-trap-errors): Rename to...
(eshell-do-command): ... this, and use 'eshell-deferrable'.  Update
callers.
(eshell--unmark-deferrable): Remove.  Update callers.
(eshell-execute-pipeline): Remove 'eshell-process-identity'.
(eshell-process-identity, eshell-named-command*, eshell-lisp-command*):
Make obsolete.

* test/lisp/eshell/esh-cmd-tests.el (eshell-test-replace-command): New
function.
(esh-cmd-test/pipeline/replace-command): New test.

(cherry picked from commit 1550213613b397da6e879cc0d00ede916f6c62cc)
lisp/eshell/esh-cmd.el
test/lisp/eshell/em-extpipe-tests.el
test/lisp/eshell/em-tramp-tests.el
test/lisp/eshell/esh-cmd-tests.el