- •What is predictive completion?
- •Obtaining and Installing
- •Quick-Start
- •Completing Words
- •Basic Completion Commands
- •Inserting Completions
- •Deleting Characters
- •Dynamic Completion
- •Completion Hotkeys
- •Displaying a List of Candidates
- •Completion Menu and Browser
- •Miscellaneous Options
- •Advanced Customisation
- •Character Syntax and Key Bindings
- •Keymaps and Key Bindings
- •Syntax
- •Working with Major Modes
- •Dictionaries
- •Creating Dictionaries
- •Loading and Saving Dictionaries
- •Basic Dictionary Usage
- •Dictionaries Local to a Region of Text
- •Dictionary Learning
- •Automatic Learning
- •Relationships Between Words
- •Bugs and Future Improvements
- •Known Bugs
- •Future Improvements
- •Credits
Chapter 4: Completing Words |
4 |
4 Completing Words
As you type, predictive mode is continually searching behind the scenes for the most likely completions of the words you are typing. However, how you make use of these depends on how intrusive you want it to be. The many options and settings let you customise it to your needs.
Predictive mode can work completely unobtrusively, so that using it has no discernible e ect until you issue a command to insert a completion (see Section 4.1 [Basic Completion Commands], page 4). It can be slightly more intrusive, so that you always see which completions are available, but can still ignore them and type normally (see Section 4.4 [Displaying a List of Candidates], page 6). It can let you select a completion candidate by hitting a hotkey (see Section 4.3 [Completion Hotkeys], page 5). Or it can work more intrusively still, by always provisionally inserting the most likely completion (see Section 4.2 [Dynamic Completion], page 5). This is probably the most e ective way to use predictive mode, but it does mean slightly changing the way you type.
4.1 Basic Completion Commands
The minor-mode command predictive-mode toggles the mode on and o . With a positive prefix argument it switches the mode on, whilst a negative prefix argument turns it o and a zero prefix argument toggles. The turn-on-predictive-mode is also provided as a convenience for use in hooks.
4.1.1 Inserting Completions
completion-cycle
(M-TAB, M-SHIFT-TAB) Cycle through available completion candidates. When supplied with a prefix argument, it will jump that many completions forwards (or backwards if the prefix argument is negative).
completion-tab-complete
(TAB) Do “traditional” tab-completion, i.e. insert the longest common prefix of all candidate completions, and re-complete the resulting longer string.
predictive-complete-word-at-point
Find completions for the word at or next to the point.
completion-cycle is probably the most useful completion command if dynamic completion and completion hotkeys are disabled. It cycles through the available completions for the current word, provisionally inserting them after the point and highlighting them to indicate they have not been accepted yet. In the default key bindings, M-TAB cycles forwards and M-SHIFT-TAB cycles backwards.
To accept a completion, simply type any end-of-word character (see Section 5.1 [Character Syntax and Key Bindings], page 8).
Normally, predictive mode finds completions as you type. Occasionally, you may need to manually force it to look for completions of a word using predictive-complete-word-at- point. If dynamic completion, completion echo, and the completion tooltip are disabled, this will not have any obvious e ect, but you can use completion-cycle to cycle through the completions it has found.
