1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-02 02:10:46 -08:00
emacs/lisp/eshell
Jim Porter 1df3554f07 Make Eshell's "which" command extensible
Since 'eshell-named-command-hook' already makes execution of commands
extensible, "which" should be too.  This makes sure that "which" returns
the right result for quoted commands like "/:cat".

* lisp/eshell/em-alias.el (eshell-aliases-file): Allow it to be nil.
(eshell-read-aliases-list, eshell-write-aliases-list): Check if
'eshell-aliases-file' is nil.
(eshell-maybe-replace-by-alias--which): New function...
(eshell-maybe-replace-by-alias): ... use it.

* lisp/eshell/esh-cmd.el (eshell-named-command-hook): Update docstring.
(eshell/which): Make extensible.
(eshell--find-plain-lisp-command, eshell-plain-command--which): New
functions.
(eshell-plain-command): Use 'eshell--find-plain-lisp-command'.

* lisp/eshell/esh-ext.el (eshell-explicit-command--which): New
function...
(eshell-explicit-command): ... unise it.
(eshell-quoted-file-command--which): New function...
(eshell-quoted-file-command): ... use it.
(eshell-external-command--which): New function.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/which/plain/eshell-builtin)
(esh-cmd-test/which/plain/external-program)
(esh-cmd-test/which/plain/not-found, esh-cmd-test/which/alias)
(esh-cmd-test/which/explicit, esh-cmd-test/which/explicit/not-found)
(esh-cmd-test/which/quoted-file)
(esh-cmd-test/which/quoted-file/not-found): New tests.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings):
Don't load or save aliases.
(eshell-command-result--match,eshell-command-result--match-explainer)
(eshell-command-result-match): New functions.
2024-05-29 19:33:13 -07:00
..
em-alias.el Make Eshell's "which" command extensible 2024-05-29 19:33:13 -07:00
em-banner.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-basic.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-cmpl.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-dirs.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-elecslash.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-extpipe.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-glob.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-hist.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-ls.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-pred.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-prompt.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-rebind.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-script.el Fix calling Eshell scripts outside of Eshell 2024-05-29 12:11:58 -07:00
em-smart.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-term.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-tramp.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-unix.el Rework how 'eshell-ensure-newline-p' adds newlines 2024-05-29 12:09:06 -07:00
em-xtra.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
esh-arg.el ; Fix typos 2024-02-04 11:06:50 +01:00
esh-cmd.el Make Eshell's "which" command extensible 2024-05-29 19:33:13 -07:00
esh-ext.el Make Eshell's "which" command extensible 2024-05-29 19:33:13 -07:00
esh-io.el Rework how 'eshell-ensure-newline-p' adds newlines 2024-05-29 12:09:06 -07:00
esh-mode.el Fix calling Eshell scripts outside of Eshell 2024-05-29 12:11:58 -07:00
esh-module.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
esh-opt.el ; Compute the list of symbols for 'eshell-eval-using-options' once 2024-02-13 12:27:38 -08:00
esh-proc.el ; Clean up some 'require' and 'declare-function' calls in Eshell 2024-05-10 09:27:30 -07:00
esh-util.el ; Fix an edge case with Eshell globs when the directory part is quoted 2024-05-09 17:15:14 -07:00
esh-var.el Document arguments to Eshell's built-in commands 2024-02-04 21:12:42 -08:00
eshell.el Fix adding to history via 'eshell-command' 2024-05-28 14:43:28 -07:00