Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also fix action functions to support being
ivy-call
ed without exiting the completion session.counsel-kmacro-kill
: Try to prevent being called outside ofcounsel-kmacro
minibuffer completion.counsel-kmacro
: Fix docstring. Ensurekmacro.el
is loaded before evaluating any variables it defines. Removekmacro-counter
from prompt; it is already listed per-kmacro in ring. Do not default tokmacro-initial-counter-value
; defer to kmacro-specific counter. Reword docs and action labels to avoid confusion betweenkmacro-initial-counter-value
andkmacro-counter
.counsel--kmacro-format-function
: Simplify.counsel--with-kmacro
: New macro for destructuring a kmacro object.counsel--format-kmacro
: New function.counsel--kmacro-candidates
: Use it andcounsel--with-kmacro
to format kmacro ring objects. Usekmacro-ring-head
. Fix staleedmacro-fix-menu-commands
warning message. Clarify docstring.counsel--kmacro-exec
: New compatibility shim forkmacro-exec-ring-item
.counsel-kmacro-action-run
: Improve docstring. Fixcurrent-prefix-arg
usage and letivy-current-prefix-arg
override it. Usecounsel--kmacro-exec
. Updateivy-last
for non-exitingivy-call
.counsel-kmacro-action-delete-kmacro
: Check whether candidate is inkmacro-ring
before deleting, instead of comparing tolast-kbd-macro
. Usekmacro-delete-ring-head
. Updateivy-last
state forivy-call
.counsel-kmacro-action-copy-initial-counter-value
,counsel-kmacro-action-copy-counter-format-for-new-macro
: Usecounsel--with-kmacro
for slot access. Clarify docstrings.counsel--kmacro-cycle-until
: New function.counsel-kmacro-action-cycle-ring-to-macro
: Use it for bounded ring cycling. Updateivy-last
for non-exitingivy-call
.counsel-kmacro-action-set-saved-starting-counter
: Clarify docstring. Avoid having to construct a kmacro object directly by cycling ring, reading new counter, and cycling back. Useread-number
. Updateivy-last
state forivy-call
.counsel-kmacro-action-execute-after-prompt
: Improve docstring. Fixcurrent-prefix-arg
usage and letivy-current-prefix-arg
override it. Useread-number
,read-string
, andformat-prompt
. Avoid kmacro destructuring viacounsel--kmacro-exec
.Fixes: #3066
Cc: @okamsn