]> git.eshelyaron.com Git - emacs.git/commit
Fix detection of directly-invokable commands in Eshell
authorJim Porter <jporterbugs@gmail.com>
Fri, 26 Jan 2024 18:17:19 +0000 (10:17 -0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 26 Jan 2024 19:03:45 +0000 (20:03 +0100)
commit4f90ec5a86b89eb9fa12e4276779bb4e4a8e32ed
tree2cb9f5845d4172edc451a6126f8a97051d1f1520
parent292435752500f87989bb8f56f5d35127e3244b15
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)
lisp/eshell/em-unix.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-mode.el
lisp/eshell/esh-var.el
test/lisp/eshell/esh-cmd-tests.el