[Top][All Lists]

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

[elpa] externals/frog-menu 8517ab9 2/4: Improve wrong key usage feedback

From: Clemens Radermacher
Subject: [elpa] externals/frog-menu 8517ab9 2/4: Improve wrong key usage feedback
Date: Tue, 30 Apr 2019 03:20:35 -0400 (EDT)

branch: externals/frog-menu
commit 8517ab94c76ed87dbfc9e862a6ebefffed540390
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Improve wrong key usage feedback
 frog-menu.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/frog-menu.el b/frog-menu.el
index e7e4cb5..5959963 100644
--- a/frog-menu.el
+++ b/frog-menu.el
@@ -504,8 +504,7 @@ buffer positions containing the candidates and default to
                 (f (lookup-key frog-menu--avy-action-map key)))
            (if (functionp f)
                (throw 'done (list f))
-             (message "No such candidate: %s, hit `C-g' to quit."
-                      (if (characterp char) (string char) char))
+             (message "No such candidate, hit `C-g' to quit.")
              (throw 'done 'restart))))))
 (defun frog-menu--init-avy-action-map (actions)
@@ -554,9 +553,12 @@ ACTIONS is the argument of `frog-menu-read'."
                 ((functionp pos)
                  ;; action
                  (funcall pos))))
-      (let ((f (lookup-key frog-menu--avy-action-map (vector (read-char)))))
-        (when (functionp f)
-          (funcall f))))))
+      (let ((f nil))
+        (while (not f)
+          (unless (setq f (lookup-key frog-menu--avy-action-map
+                                      (vector (read-char))))
+            (message "No such action, hit C-g to quit.")))
+        (funcall f)))))
 ;; * Entry point
@@ -629,3 +631,4 @@ RETURN will be the returned value if KEY is pressed."
 (provide 'frog-menu)
 ;;; frog-menu.el ends here

reply via email to

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