emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/meow 809b059dd4: Better error handling in keypad


From: ELPA Syncer
Subject: [nongnu] elpa/meow 809b059dd4: Better error handling in keypad
Date: Sun, 1 Dec 2024 22:01:53 -0500 (EST)

branch: elpa/meow
commit 809b059dd412c19ecd3a3578f422900e3402069c
Author: DogLooksGood <doglooksgood@hotmail.com>
Commit: DogLooksGood <doglooksgood@hotmail.com>

    Better error handling in keypad
---
 meow-keypad.el | 56 +++++++++++++++++++++++++++-----------------------------
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/meow-keypad.el b/meow-keypad.el
index 8135f84458..e0670bac52 100644
--- a/meow-keypad.el
+++ b/meow-keypad.el
@@ -444,14 +444,18 @@ try replacing the last modifier and try again."
         t)))))
 
 (defun meow--keypad-handle-input-with-keymap (input-event)
-  "Handle INPUT-EVENT with `meow-keypad-state-keymap'."
-  (let* ((k (if (= 27 input-event)
-                [escape]
-              (kbd (single-key-description input-event))))
-         (cmd (lookup-key meow-keypad-state-keymap k)))
-    (if cmd
-        (call-interactively cmd)
-      (meow--keypad-handle-input-event input-event))))
+  "Handle INPUT-EVENT with `meow-keypad-state-keymap'.
+
+Return t if handling is completed."
+  (if (numberp input-event)
+      (let* ((k (if (= 27 input-event)
+                    [escape]
+                  (kbd (single-key-description input-event))))
+             (cmd (lookup-key meow-keypad-state-keymap k)))
+        (if cmd
+            (call-interactively cmd)
+          (meow--keypad-handle-input-event input-event)))
+    (meow--keypad-quit)))
 
 (defun meow--keypad-handle-input-event (input-event)
   ""
@@ -513,33 +517,27 @@ try replacing the last modifier and try again."
 (defun meow-keypad-start ()
   "Enter keypad state with current input as initial key sequences."
   (interactive)
-  (condition-case _
-      (progn
-        (setq this-command last-command
-              meow--keypad-keys nil
-              meow--keypad-previous-state (meow--current-state)
-              meow--prefix-arg current-prefix-arg)
-        (meow--switch-state 'keypad)
-        (meow--keypad-handle-input-with-keymap last-input-event)
-        (while (not (meow--keypad-handle-input-with-keymap (read-key)))))
-    (t (meow--keypad-quit))))
+  (setq this-command last-command
+        meow--keypad-keys nil
+        meow--keypad-previous-state (meow--current-state)
+        meow--prefix-arg current-prefix-arg)
+  (meow--switch-state 'keypad)
+  (meow--keypad-handle-input-with-keymap last-input-event)
+  (while (not (meow--keypad-handle-input-with-keymap (read-key)))))
 
 (defun meow-keypad-start-with (input)
   "Enter keypad state with INPUT.
 
 A string INPUT, stands for initial keys.
 When INPUT is nil, start without initial keys."
-  (condition-case e
-      (progn
-        (setq this-command last-command
-              meow--keypad-keys (when input (meow--parse-string-to-keypad-keys 
input))
-              meow--keypad-previous-state (meow--current-state)
-              meow--prefix-arg current-prefix-arg)
-        (meow--switch-state 'keypad)
-        (meow--keypad-show-message)
-        (meow--keypad-display-message)
-        (while (not (meow--keypad-handle-input-with-keymap (read-key)))))
-    (t (meow--keypad-quit))))
+  (setq this-command last-command
+        meow--keypad-keys (when input (meow--parse-string-to-keypad-keys 
input))
+        meow--keypad-previous-state (meow--current-state)
+        meow--prefix-arg current-prefix-arg)
+  (meow--switch-state 'keypad)
+  (meow--keypad-show-message)
+  (meow--keypad-display-message)
+  (while (not (meow--keypad-handle-input-with-keymap (read-key)))))
 
 (defun meow-keypad-describe-key ()
   "Describe key via KEYPAD input."



reply via email to

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