Skip to content

Commit

Permalink
Add meow-keypad-execute-on-beacons
Browse files Browse the repository at this point in the history
  • Loading branch information
DogLooksGood committed Nov 9, 2024
1 parent 162f60b commit 574773e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
19 changes: 18 additions & 1 deletion meow-keypad.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
(require 'meow-var)
(require 'meow-util)
(require 'meow-helpers)
(require 'meow-beacon)

(defun meow--keypad-format-upcase (k)
"Return S-k for upcase k."
Expand Down Expand Up @@ -367,6 +368,22 @@ Returning DEF will result in a generated title."
(propertize pre 'face 'font-lock-comment-face)))
(propertize (meow--keypad-format-keys nil) 'face 'font-lock-string-face))))

(defun meow--keypad-execute (command)
"Execute the COMMAND.
If there are beacons, execute it at every beacon."
(cond
((and meow-keypad-execute-on-beacons
(not defining-kbd-macro)
(not executing-kbd-macro)
(meow--beacon-inside-secondary-selection)
meow--beacon-overlays)
(call-interactively command)
(meow--beacon-apply-command command))

(t
(call-interactively command))))

(defun meow--keypad-try-execute ()
"Try execute command.
Expand All @@ -389,7 +406,7 @@ try replacing the last modifier and try again."
(meow--keypad-quit)
(setq real-this-command cmd
this-command cmd)
(call-interactively cmd))))
(meow--keypad-execute cmd))))
((keymapp cmd)
(when meow-keypad-message (meow--keypad-show-message))
(meow--keypad-display-message))
Expand Down
8 changes: 8 additions & 0 deletions meow-var.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ This will affect how selection is displayed."
:group 'meow
:type '(repeat sexp))

(defcustom meow-keypad-execute-on-beacons nil
"Execute keypad command directly on beacons when using it directly from
beacon state.
This doesn't affect how keypad works on recording or executing a kmacro."
:group 'meow
:type 'boolean)

(defcustom meow-selection-command-fallback
'((meow-change . meow-change-char)
(meow-kill . meow-C-k)
Expand Down

0 comments on commit 574773e

Please sign in to comment.