Fix detection of directly-invokable commands in Eshell
I think this regressed partly due to
eef32d13da58, so let's add some
regression tests to make sure that doesn't happen again.
* lisp/eshell/em-unix.el (eshell-unix-initialize): Add "compile".
* lisp/eshell/esh-cmd.el (eshell--find-subcommands): Yield the second
element of the subcommand.
(eshell--invoke-command-directly-p): Rename and account for
'eshell-with-copied-handles'.
(eshell-invoke-directly): Rename to...
(eshell-invoke-directly-p): ... this, and use 'pcase' to make the
logic clearer.
* lisp/eshell/esh-mode.el (eshell-send-input): Always queue input if
the process is running; rename some locals to be clearer.
* lisp/eshell/esh-var.el (eshell-var-initialize): Add "env" as a
complex command.
* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test--deftest-invoke-directly): New macro.
(no-args, with-args, multiple-cmds, subcmd, complex, complex-subcmd):
New test cases.
(cherry picked from commit
047607f6e611709f89f6c93ae0e2fc97b25bf18f)