emacs-which-key
emacs-which-key copied to clipboard
Feature request: Per keymap delays
If I could specify the delay for a specific keymap:
(put 'ctl-x-r-map 'which-key-idle-delay 0.0)
This would allow which-key to cover most of the cases where I use Hydra.
Hm, it's not straightforward to determine which keymaps are active in the middle of an arbitrary key sequence (unless you know of one), so your proposal would not be easy to implement.
I had a different idea though, which was to hack key definitions like this
(define-key ctl-x-r-map [which-key-delay] "0.0")
You could define the key recursively to hit the whole map. The idea would then be that the lowest delay value in an active map determines the delay.
I forgot there's a way to do roughly this that is built in already. Try
(defun my-delay-function (key-desc _)
(unless (string-match-p "^C-x r" key-desc) 5))
(add-hook 'which-key-delay-functions 'my-delay-function)