The Completion User Interface package is a library that implements user-interfaces for in-buffer completion.
Typically, in packages providing some kind of text completion, a large amount of code deals with providing the user interface rather than finding good completions. The goal of Completion-UI is to be the swiss-army knife of in-buffer completion user-interfaces; a library which any completion package can use to provide an in-buffer completion user-interface, thereby freeing completion package writers to concentrate on the task of finding the completions in the first place.
In fact, Completion-UI is even better than a swiss-army knife, because it's also extensible: it's easy1 1If you're an Elisp coder! to add new completion user-interfaces and hook them into Completion-UI. The new interface will then be available to any completion package that uses the Completion-UI library, without needing to make any changes to that package.
Various standard completion user-interfaces and commands are provided "out of the box". These can be separately enabled, disabled and tweaked by the Emacs user via the usual bewildering array of customization variables.
The UIs provided with the package are:
auto-completion-mode
The philosophy of Completion-UI is that customization of the user-interface should be left up to users. They know what they want better than you (the package author) do! And by providing a universal user-interface that can be used by all completion packages, Completion-UI lets users customize their in-buffer completion user interface once-and-for-all to suit their tastes, rather than having to learn how to customize the UI for each completion package separately.
The default Completion-UI key bindings that are enabled when you're completing a word are:
M-<tab>
M-/
M-S-<tab> =M-?
C-<ret>
C-<del>
<tab>
C-<tab>
S-<down>
<up>
and <down>
to cycle).M-<down>
C-<down>
S-<up>
C-<up>
M-<up>
(in pop-up frame)M-/
(in pop-up frame)The current release of the Completion-UI package is version 0.12 (released February 2013). However, it's still under active development at the moment, so don't forget to check back here for updates every so often. If you want to live on the bleeding edge, the latest "development" version of the Completion-UI package is hosted in the same git repository as the Predictive Completion package.
http://www.dr-qubit.org/git/predictive.git
Note that the git repository URL is a git repository, not a web-site. You cannot view it in a web browser. To grab the latest development version, clone the repository using something like:
git clone http://www.dr-qubit.org/git/predictive.git
To install, simply extract the files to a directory in your Emacs load-path
, and add the line:
(require 'completion-ui)
to your .emacs
file.
If you're an Emacs user interested in using Completion-UI (as opposed to an Elisp programmer interesting in extending Completion-UI or making use of it in your own package), then the first section of the Completion-UI manual would contain all the information you could possibly need…were it to exist. In the meantime, the description given above should get you started, and all the commands and customization options are reasonably well documented via the standard, built-in, Emacs documentation features. All the relevant customization options can be found in the completion-ui
customization group (and subgroups thereof).
If you're interested in extending Completion-UI with a new user-interface or new completion source, or want to make use of Completion-UI in your own package, then full documentation will…ahem…shortly be available in a variety of formats, for download and viewing online. In the meantime, the docstrings for completion-ui-register-interface
and completion-ui-register-source
should get you started.
Hello and thank you for the wonderful packages. Is there any plan to support Emacs 26?
@Tony #1: I use all my Emacs packages myself in Emacs 26, and they seem to work OK. For the predictive and completion-UI packages you might need the version from Git, as I haven't rolled a release tarball in many years. (I've been doing some development recently that should finally let me get these last two packages on ELPA. Stay tuned…)
Hello, i use your predictive package since some days. Now i've got it to work. But there are some open problems you could clear for me:
Regards Poul
…i forgot to mention: i use Emacs 26.1 on linux mint 19.1. Regards Poul
@Poul Poulson #3: You don't say whether you're using the git version of the predictive package (recommended!) or the last tarball release (very out of date!).
predictive
or completion-UI
unless a completion is already in progress. So they shouldn't interfere with anything (I'm a heavy org-mode
user myself). If you want M-tab to start predictive completion, bind it to complete-predictive
.
The normal and `fast' learning functions got merged in the git version. The only command you need for learning words from a buffer is predictive-learn-from-buffer
. The documentation in git hasn't been updated to match :-( The docstrings are a more reliable source of information than the manual for the git version.
Note that predictive-learn-from-buffer
behaves exactly like accepting each word in the buffer as a completion. This means if predictive-auto-add-to-dict
is not set (the default), it will only update the weights of existing words in the dictionary, not add new ones. To have all words added, you need to set predictive-auto-add-to-dict
to t (at least temporarily).
Leave a comment
All comments are moderated. Clicking submit will open your email client and let you send your comment by email. By submitting your comment you agree to license the content under a Creative Commons Attribution-ShareAlike 4.0 International License.