justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.74k stars 87 forks source link

which-key-add-keymap-based-replacements for prefix #316

Open Ergus opened 3 years ago

Ergus commented 3 years ago

Hi:

I use the command which-key-add-keymap-based-replacements to substitute the +prefix entries when possible.

Up to now I have something like (which-key-add-keymap-based-replacements flyspell-mode-map "C-c f" "flyspell") but I see that the new syntax wants a const pair there as the last argument...

What's the intended way to specify that? use a nil?

justbur commented 3 years ago

It should actually accept what you have there. Is that line not working?

Ergus commented 3 years ago

It should actually accept what you have there. Is that line not working?

Yes, it works, but it is not a cons pair. That is the recommended way to do it according to the documentation.

justbur commented 3 years ago

The cons pair is more explicit. The string version is for backwards compatibility. With a string, the function constructs the cons pair (STRING . BINDING) by looking up the corresponding key binding.