[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 9a15d1f 103/110: avy.el (avy-show-dispatch-help): Add and

From: Oleh Krehel
Subject: [elpa] master 9a15d1f 103/110: avy.el (avy-show-dispatch-help): Add and bind to "?"
Date: Sat, 11 May 2019 10:15:54 -0400 (EDT)

branch: master
commit 9a15d1f37b99a18d8f05e0c4f7362b67e6766130
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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)))
            (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'.")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]