1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 12:40:49 -08:00
emacs/test/lisp/eshell
Jim Porter cde38f0df3 Avoid parsing some Eshell forms when performing completion
During completion, we want to evaluate most Eshell forms
(e.g. variable references), but skip others (e.g. globbing,
subcommands).  For globbing, we want to pass the literal glob to
Pcomplete so it can use the glob for selecting completion candidates.
For subcommands (including Lisp forms), we especially want to avoid
evaluation, since they can produce arbitary side effects!  (Bug#50470)

* lisp/eshell/esh-cmd.el (eshell-allow-commands): New variable...
(eshell-commands-forbidden): New error...
(eshell-named-command, eshell-lisp-command): ... use them.

* lisp/eshell/em-cmpl.el (eshell-complete--eval-argument-form):
Disallow command forms and handle errors ourselves.
(eshell-complete-parse-arguments): Don't parse glob characters.

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/parse-arguments/unevaluated-subcommand)
(em-cmpl-test/parse-arguments/unevaluated-lisp-form)
(em-cmpl-test/parse-arguments/unevaluated-inner-subcommand)
(em-cmpl-test/file-completion/glob, em-cmpl-test/command-completion)
(em-cmpl-test/subcommand-completion): New tests.
(em-cmpl-test/parse-arguments/pipeline): Remove superfluous
let-binding.
(em-cmpl-test/file-completion/after-list): Use a list variable rather
than a subexpression; the latter is no longer evaluated during
completion.
(em-cmpl-test/lisp-function-completion): Check "$(func)" syntax.
2023-03-28 12:03:29 -07:00
..
em-alias-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
em-basic-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-cmpl-tests.el Avoid parsing some Eshell forms when performing completion 2023-03-28 12:03:29 -07:00
em-dirs-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-extpipe-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
em-glob-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-hist-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-ls-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-pred-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
em-prompt-tests.el Ensure that Eshell users can run lines of command output as input 2023-02-09 22:32:51 -08:00
em-script-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
em-tramp-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
esh-arg-tests.el Add support for completing special references (e.g. buffers) in Eshell 2023-03-11 18:49:28 -08:00
esh-cmd-tests.el Ensure that deferred commands don't make Eshell forget let-bound values 2023-02-09 21:38:07 -08:00
esh-ext-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
esh-io-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
esh-opt-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
esh-proc-tests.el Don't try to make a pipe process for remote processes in Eshell 2023-01-23 09:48:09 -08:00
esh-util-tests.el Make 'eshell-number-regexp' into a regular defvar 2023-01-27 18:03:10 -08:00
esh-var-tests.el Simplify parsing subcommands slightly 2023-03-28 12:02:46 -07:00
eshell-tests-helpers.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
eshell-tests-unload.el Allow unloading Eshell 2023-02-15 17:31:52 -08:00
eshell-tests.el Ensure that Eshell users can run lines of command output as input 2023-02-09 22:32:51 -08:00