Skip to content

Commit 574773e

Browse files
committed
Add meow-keypad-execute-on-beacons
1 parent 162f60b commit 574773e

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

meow-keypad.el

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
(require 'meow-var)
4141
(require 'meow-util)
4242
(require 'meow-helpers)
43+
(require 'meow-beacon)
4344

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

371+
(defun meow--keypad-execute (command)
372+
"Execute the COMMAND.
373+
374+
If there are beacons, execute it at every beacon."
375+
(cond
376+
((and meow-keypad-execute-on-beacons
377+
(not defining-kbd-macro)
378+
(not executing-kbd-macro)
379+
(meow--beacon-inside-secondary-selection)
380+
meow--beacon-overlays)
381+
(call-interactively command)
382+
(meow--beacon-apply-command command))
383+
384+
(t
385+
(call-interactively command))))
386+
370387
(defun meow--keypad-try-execute ()
371388
"Try execute command.
372389
@@ -389,7 +406,7 @@ try replacing the last modifier and try again."
389406
(meow--keypad-quit)
390407
(setq real-this-command cmd
391408
this-command cmd)
392-
(call-interactively cmd))))
409+
(meow--keypad-execute cmd))))
393410
((keymapp cmd)
394411
(when meow-keypad-message (meow--keypad-show-message))
395412
(meow--keypad-display-message))

meow-var.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ This will affect how selection is displayed."
4646
:group 'meow
4747
:type '(repeat sexp))
4848

49+
(defcustom meow-keypad-execute-on-beacons nil
50+
"Execute keypad command directly on beacons when using it directly from
51+
beacon state.
52+
53+
This doesn't affect how keypad works on recording or executing a kmacro."
54+
:group 'meow
55+
:type 'boolean)
56+
4957
(defcustom meow-selection-command-fallback
5058
'((meow-change . meow-change-char)
5159
(meow-kill . meow-C-k)

0 commit comments

Comments
 (0)