branch: master commit 9a15d1f37b99a18d8f05e0c4f7362b67e6766130 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
avy.el (avy-show-dispatch-help): Add and bind to "?" Fixes abo-abo/ace-window#91 --- avy.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/avy.el b/avy.el index ce7fba9..c8af0b9 100644 --- a/avy.el +++ b/avy.el @@ -456,12 +456,28 @@ KEYS is the path from the root of `avy-tree' to LEAF." ((memq char '(27 ?\C-g)) ;; exit silently (throw 'done 'exit)) + ((eq char ??) + (avy-show-dispatch-help) + (throw 'done 'restart)) ((mouse-event-p char) (signal 'user-error (list "Mouse event not handled" char))) (t (message "No such candidate: %s, hit `C-g' to quit." (if (characterp char) (string char) char)))))) +(defun avy-show-dispatch-help () + "Display action shortucts in echo area." + (let ((len (length "avy-action-"))) + (message "%s" (mapconcat + (lambda (x) + (format "%s: %s" + (propertize + (char-to-string (car x)) + 'face 'aw-key-face) + (substring (symbol-name (cdr x)) len))) + avy-dispatch-alist + " ")))) + (defvar avy-handler-function 'avy-handler-default "A function to call for a bad `read-key' in `avy-read'.")