1. Introduce using-show-keymap and using-show-operator-keymap vars to
make it clear how we are entering which-key
2. Add inhibit-next-operator-keymap for keys in the operator maps that
are bound to commands that read the next key "manually"
3. Fix problem where the next page hint was only being shown sometimes
in the operator maps. Need to distinguish between show-operator-keymap
and the possibility that an operator is active but the usual which-key
popup is showing.
Allows to recover from accidentally pressing C-h.
This commit also fixes some echo area problems that become apprent after
introducing the C-h-map stuff
Replace role of show-next-page with C-h-dispatch which immediately reads
a key and calls a command from C-h-map, which may be one of several
paging commands, a command to undo the last keypress, or a command to
directly access describe-prefix-bindings.
This commit does not include documenting these changes in the readme.
Note that several options become deprecated here as they no longer have
the same (if any effect).
This takes the idea in the previous commit and translates the
representations of keys in the alists to be the output of
key-description. The issue is that `M-x` for example has two
representations with listify-key-sequence, but only one (it seems) from
key-description.
When running emacs in a terminal (or at least, in iTerm), keys are not
passed through to emacs the same way that they are in graphical mode.
For example, M-m (important in spacemacs) is the key-sequence
`[134217837]` in graphical emacs, but `[27 109]` ("ESC m") in terminal.
The variable `which-key-prefix-name-alst` only has a mapping for the
former (the 134217837), and so the names of submenus all show up as
"+prefix", limiting discoverability.
This commit converts the key sequence into a canonical form (eg:
converts `[27 109]` into `[134217837]`) in
`which-key--maybe-replace-prefix-name`, so that the prefixes are found.
I think some work is probably needed for
`which-key-prefix-title-alist` too, but I'm not entirely sure what
that's used for, so I didn't mess with it.