emacs-which-key icon indicating copy to clipboard operation
emacs-which-key copied to clipboard

Feature request: Per keymap delays

Open jwiegley opened this issue 7 years ago • 2 comments

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.

jwiegley avatar Nov 24 '17 17:11 jwiegley

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.

justbur avatar Nov 28 '17 16:11 justbur

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)

justbur avatar Dec 03 '17 04:12 justbur