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.
If echo-keystrokes is non nil, we're showing in the bottom window, and
the prefix is shown in the top or bottom line, there's not much reason
to show the prefix again since it's so close to the echo area.
'bottom is a "safer" default because it's impossible to control the echo
area completely, so the message gets wiped out occasionally.
Use prefix-titles for the top-level bindings message, since top-level is
not really a key