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)