From bf4c7d8559715e0fc6d620d4df99209c686c423b Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 31 Mar 2016 10:51:32 -0400 Subject: [PATCH] Support key-chord Fixes #108 --- which-key.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/which-key.el b/which-key.el index a0f226bb393..2706a99062b 100644 --- a/which-key.el +++ b/which-key.el @@ -2021,6 +2021,18 @@ Finally, show the buffer." ;; (message "key: %s" (key-description prefix-keys))) ;; (when (> (length prefix-keys) 0) ;; (message "key binding: %s" (key-binding prefix-keys))) + ;; Taken from guide-key + (when (and (equal prefix-keys [key-chord]) + (bound-and-true-p key-chord-mode)) + (setq prefix-keys + (condition-case nil + (let ((rkeys (recent-keys))) + (vector 'key-chord + (aref rkeys (- (length rkeys) 2)) + (aref rkeys (- (length rkeys) 1)))) + (error (progn + (message "which-key error in key-chord handling") + [key-chord]))))) (cond ((and (> (length prefix-keys) 0) (or (keymapp (key-binding prefix-keys)) ;; Some keymaps are stored here like iso-transl-ctl-x-8-map