]> git.eshelyaron.com Git - emacs.git/commit
Add support for completing quoted variables in Eshell like $'FOO'
authorJim Porter <jporterbugs@gmail.com>
Thu, 2 Feb 2023 01:48:43 +0000 (17:48 -0800)
committerJim Porter <jporterbugs@gmail.com>
Thu, 23 Feb 2023 22:09:36 +0000 (14:09 -0800)
commit4b364a990a06cd73b553fdc9e9a65bc7398dbea6
tree432c1c3abe9bd58932cf3a798bb209a797b0bfc5
parent2f110132d735b3a3db0c4ee29f2a7d49ff2525be
Add support for completing quoted variables in Eshell like $'FOO'

This also adds the ability for Pcomplete handlers to set their own
exit functions that will get called as appropriate.

* lisp/pcomplete.el (pcomplete-default-exit-function): New function.
(pcomplete-exit-function): New variable...
(pcomplete-completions-at-point): ... let-bind and use it.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): Handle
quoted variables.  We also build the 'posns' list from right-to-left
now.

* lisp/eshell/esh-var.el (eshell-envvar-names): Ensure that variable
aliases are included in this list.
(eshell-complete-variable-reference): Handle quoted variables and set
the exit function on the completions.
(eshell-variables-list): Simplify.  We now add the trailing slash for
directories in the exit function inside
'eshell-complete-variable-reference'.

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/quoted-variable-ref-completion)
(em-cmpl-test/variable-ref-completion/directory): New tests.
lisp/eshell/em-cmpl.el
lisp/eshell/esh-var.el
lisp/pcomplete.el
test/lisp/eshell/em-cmpl-tests.el