]> git.eshelyaron.com Git - emacs.git/commit
Add 'external' completion style for completions from external tools
authorJoão Távora <joaotavora@gmail.com>
Fri, 25 Nov 2022 13:03:45 +0000 (13:03 +0000)
committerJoão Távora <joaotavora@gmail.com>
Wed, 7 Dec 2022 11:00:38 +0000 (11:00 +0000)
commit23d5968eae96d1e0d4eaa1df3c00fd6ecb088420
treedbc5f410bdc3f6d37834fa364121412dff759ff4
parent82849f9a20bcc043b23c59905044b7f69d8f54a1
Add 'external' completion style for completions from external tools

This completion style has been in use in Eglot and other third-party
extensions for a long time.  It's meant for libraries that interface
with an external tool which provides completions, such as a shell
utility, an inferior process, an http server.

The new file lisp/external-completion.el provides a helper function,
external-completion-table which is given an interfacing function to
the external tool and returns a "programmed completion" table that is
bound to the 'external' completion style.  That table can then be used
with completing-read or any other facility expecting a completion
table.

When the 'external' is in use, the usual styles configured by the user
or other in 'completion-styles' are completely overriden.  This
relatively minor inconvenience is the price to pay for responsive
completion where the full set of completion candidates doesn't need to
be transfered into Emacs's address space.

* lisp/external-completion.el: New file.
lisp/external-completion.el [new file with mode: 0644]