This page is about library keysee.el, which provides completion of key sequences and menu-bar menus. It requires library sortie.el (see Sortie), which lets you sort completion candidates in different ways interactively.
It is essentially a reduced-functionality version of Icicles key completion.
Turn on minor mode
‘kc-mode’ to enable completion on demand whenever you hit
‘S-TAB’, for keys and menu-bar menus. (You can customize the key(s) for this, using option
This means you can hit
‘S-TAB’ at top level, to see all possible keys, or after any prefix key, to see all possible keys at that level.
If you want to complete just menu-bar menus, you can use command
In addition to key completion on demand, you can automatically complete prefix keys using minor mode
‘kc-auto-mode’. After a short delay when you hit a prefix key, it provides the same kind of completion as
‘kc-mode’. You can customize the delay with option
‘kc-auto-mode’ includes the on-demand completion of
‘kc-mode’, so you can still use
‘S-TAB’ at top level. And if you have a long enough
‘kc-auto-delay’ you can take time to think or use
‘S-TAB’ at any level to show completions immediately.
‘kc-auto-mode’ thus turns on
‘kc-mode’. Turning either mode off turns off the other as well. So if you want both, turn on
‘kc-auto-mode’; if you want only on-demand completion, turn on
When completions are shown, the completion candidates have one of these forms:
.. PREFIX-KEY = ... KEY = COMMAND
..’, is shown only when completing a prefix key. Choosing it takes you back up one level, to the parent prefix key, or to the top level if there is no parent. For example, if you are currently completing prefix key
‘C-x 4’, then `
..’ takes you back up to the completions for prefix key
‘C-x’. Using `
..’ there then takes you up from that level to the top level. When `
..’ is a candidate it is the default, so you can just hit
‘RET’to go up a level.
PREFIX-KEY = ...’ takes you down a level, to the keys on that
PREFIX-KEY. For example, at top level, choosing completion candidate `
C-x = ...’ takes you to completions for prefix key
KEY = COMMAND’ invokes
Completion uses the completion styles defined by option
‘kc-completion-styles’, not those of standard option
‘completion-styles’. This means you can have different preferred styles for key completion. By default, the setting favors
‘substring’, and then
‘flex’ (Emacs 27 or later) completion.
You can use option
‘kc-separator’ to customize the separator `
= ’. The default value has 2 space chars on each side of `
=’, so you can more easily match menu candidates that contain a space char.
Completion is as usual in vanilla Emacs: type characters to match completion candidates, use
‘TAB’ to complete, use
‘RET’ to accept a completion.
The following completion-candidate sort orders are available. You can cycle among them during completion using the key that is the value of option
C-,’ by default).
You can cycle candidates using
‘TAB’, according to option
For top-level key completion (keys in
‘S-TAB’), you can use option
‘kc-keymaps-for-key-completion’ to choose which keymaps in which to bind
‘kc-complete-keys’. Normally, if a key in
‘kc-keymaps-for-key-completion’ is already bound in a map listed in that option value then that binding is respected - the key is not bound to
‘kc-complete-keys’. You can override this by customizing option
‘kc-bind-completion-keys-anyway-flag’ to non-
Suggested key binding:
(global-set-key (kbd "S-<f10>") kc-complete-menu-bar)