Skip to content

Commit

Permalink
Quit keypad with C-g
Browse files Browse the repository at this point in the history
  • Loading branch information
DogLooksGood committed Dec 4, 2024
1 parent c82a324 commit 49bfe25
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions meow-keypad.el
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ Returning DEF will result in a generated title."
"Execute the COMMAND.
If there are beacons, execute it at every beacon."

(if (meow--keypad-in-beacon-p)
(cond
((member command '(kmacro-start-macro kmacro-start-macro-or-insert-counter))
Expand Down Expand Up @@ -520,8 +519,12 @@ Return t if handling is completed."
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)))))
(unwind-protect
(progn
(meow--keypad-handle-input-with-keymap last-input-event)
(while (not (meow--keypad-handle-input-with-keymap (read-key)))))
(when (bound-and-true-p meow-keypad-mode)
(meow--keypad-quit))))

(defun meow-keypad-start-with (input)
"Enter keypad state with INPUT.
Expand All @@ -533,9 +536,13 @@ When INPUT is nil, start without initial keys."
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)))))
(unwind-protect
(progn
(meow--keypad-show-message)
(meow--keypad-display-message)
(while (not (meow--keypad-handle-input-with-keymap (read-key)))))
(when (bound-and-true-p meow-keypad-mode)
(meow--keypad-quit))))

(defun meow-keypad-describe-key ()
"Describe key via KEYPAD input."
Expand Down

0 comments on commit 49bfe25

Please sign in to comment.