1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 04:30:45 -08:00
emacs/test/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-tests.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
em-basic-tests.el Support setting umask symbolically in Eshell 2024-01-27 22:21:23 -08:00
em-cmpl-tests.el ; Fix test failures from the fix for bug#67661 2024-01-17 09:32:18 -08:00
em-dirs-tests.el In Eshell, don't expand quoted tildes into a user's home directory 2024-01-28 16:02:05 -08:00
em-extpipe-tests.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
em-glob-tests.el Add new Eshell built-in command 'funcall' 2024-05-16 20:33:18 -07:00
em-hist-tests.el Erase existing duplicates in eshell-history-ring 2024-05-24 19:29:20 -07:00
em-ls-tests.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
em-pred-tests.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
em-prompt-tests.el ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
em-script-tests.el Fix calling Eshell scripts outside of Eshell 2024-05-29 12:11:58 -07:00
em-tramp-tests.el Fix command replacement with the Eshell builtin versions of "sudo" and "doas" 2024-01-27 12:22:57 -08:00
em-unix-tests.el ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
esh-arg-tests.el In Eshell, allow an escaped newline at the end of a command 2024-01-28 15:54:46 -08:00
esh-cmd-tests.el Make Eshell's "which" command extensible 2024-05-29 19:33:13 -07:00
esh-ext-tests.el Use "/local:" prefix in Eshell to run local commands when cwd is remote 2024-05-15 18:50:54 -07:00
esh-io-tests.el Add ability for Eshell virtual targets to handle closing the target 2024-05-29 12:09:05 -07:00
esh-opt-tests.el ; Compute the list of symbols for 'eshell-eval-using-options' once 2024-02-13 12:27:38 -08:00
esh-proc-tests.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
esh-util-tests.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
esh-var-tests.el Add new Eshell built-in command 'funcall' 2024-05-16 20:33:18 -07:00
eshell-tests-helpers.el Make Eshell's "which" command extensible 2024-05-29 19:33:13 -07:00
eshell-tests-unload.el Consolidate Eshell module loading/unloading code 2024-05-29 12:09:05 -07:00
eshell-tests.el Replace use of obsolete eshell-kill-output in test 2024-02-23 13:14:18 +01:00