Next: , Up: Character Syntax and Key Bindings


6.1.1 Keymaps and Key Bindings

The following keymaps are defined by predictive mode:

predictive-map
Main keymap, enabled whenever predictive mode is.
auto-completion-map
Keymap enabled whenever auto-completion-mode is.
completion-hotkey-list
List of hotkey characters to use for selecting completions. Default is numerical characters 0 to 9.
completion-overlay-map auto-completion-overlay-map
Keymaps active when the point is at or within a completion.
completion-dynamic-map
Keymap used when completion-use-dynamic is enabled.
completion-tooltip-map
Keymap used when completion-use-tooltip is enabled.
completion-tooltip-active-map
Keymap active when the completion tooltip is displayed.
completion-menu-map
Keymap used when completion-use-menu is enabled.
completion-popup-frame-map
Keymap used when completion-use-popup-frame is enabled.
completion-popup-frame-mode-map
Keymap active in the completion pop-up frame.

The various keymaps define key bindings for different situations that arise in predictive mode. The main predictive-map keymap is enabled whenever predictive mode is enabled, and auto-completion-map is enabled whenever auto-completion-mode is. Note: if you find yourself thinking of re-binding printable characters in auto-completion-map to something other than completion-self-insert, don't! (at least not until you've read on a bit). What you probably want to change are the auto-completion-syntax-alist and auto-completion-override-syntax-alist variables. See Syntax.

completion-overlay-map and auto-completion-overlay-map are active when the point is located at a completion. The former is used when auto-completion-mode is disabled, the latter when it is enabled. They are used to provide key bindings for most of the completion features.

The key bindings in the keymaps enabled by the completion-use-* customization variables are effectively added to completion-overlay-map, so they are active when the point is in a completion and the corresponding user-interface is enabled.

If the keymaps are not defined when predictive mode is first loaded (see Obtaining and Installing), it creates the default keymaps and loads them into Emacs. Therefore, to completely re-define predictive mode key bindings, it is simpler to re-define the keymap variables before loading predictive mode (e.g. before the (require 'predictive) line in your .emacs file, see Obtaining and Installing). (However, doing this for the auto-completion-mode-map will almost certainly break auto-completion-mode entirely!) But if you simply want to modify a few key bindings, as will usually be the case, you can do it in the usual Emacs way, after loading predictive mode in your .emacs file.