[Top][All Lists]

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

[elpa] master 176f34f 051/110: avy.el (avy-handler-default): Error msg o

From: Oleh Krehel
Subject: [elpa] master 176f34f 051/110: avy.el (avy-handler-default): Error msg on mouse clicks
Date: Sat, 11 May 2019 10:15:41 -0400 (EDT)

branch: master
commit 176f34f4913d44efa29d84fd977a76ffb20a9b43
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy-handler-default): Error msg on mouse clicks
    Re #226
 avy.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/avy.el b/avy.el
index c03bb61..dc1dba7 100644
--- a/avy.el
+++ b/avy.el
@@ -424,6 +424,8 @@ KEYS is the path from the root of `avy-tree' to LEAF."
           ((memq char '(27 ?\C-g))
            ;; exit silently
            (throw 'done 'exit))
+          ((avy-mouse-press-event-p char)
+           (signal 'user-error "Mouse event not handled" char))
            (signal 'user-error (list "No such candidate" char))
            (throw 'done nil)))))
@@ -872,10 +874,11 @@ Do this even when the char is terminating."
 (defun avy--key-to-char (c)
   "If C is no character, translate it using `avy-key-to-char-alist'."
-  (if (characterp c)
-      c
-    (or (cdr (assoc c avy-key-to-char-alist))
-        (error "Unknown key %s" c))))
+  (cond ((characterp c) c)
+        ((cdr (assoc c avy-key-to-char-alist)))
+        ((mouse-event-p c) c)
+        (t
+         (error "Unknown key %s" c))))
 (defun avy-candidate-beg (leaf)
   "Return the start position for LEAF."

reply via email to

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