-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit 6f10460
committed
Port counsel-kmacro to OClosures
Also fix action functions to support being ivy-called without
exiting the completion session.
* counsel.el (counsel-kmacro-kill): Try to prevent being called
outside of counsel-kmacro minibuffer completion.
(counsel-kmacro): Fix docstring. Ensure kmacro.el is loaded before
evaluating any variables it defines. Remove kmacro-counter from
prompt; it is already listed per-kmacro in ring. Do not default to
kmacro-initial-counter-value; defer to kmacro-specific counter.
Reword docs and action labels to avoid confusion between
kmacro-initial-counter-value and kmacro-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 and counsel--with-kmacro to
format kmacro ring objects. Use kmacro-ring-head. Fix stale
edmacro-fix-menu-commands warning message. Clarify docstring.
(counsel--kmacro-exec): New compatibility shim for
kmacro-exec-ring-item.
(counsel-kmacro-action-run): Improve docstring. Fix
current-prefix-arg usage and let ivy-current-prefix-arg override it.
Use counsel--kmacro-exec. Update ivy-last for non-exiting ivy-call.
(counsel-kmacro-action-delete-kmacro): Check whether candidate is in
kmacro-ring before deleting, instead of comparing to last-kbd-macro.
Use kmacro-delete-ring-head. Update ivy-last state for ivy-call.
(counsel-kmacro-action-copy-initial-counter-value)
(counsel-kmacro-action-copy-counter-format-for-new-macro): Use
counsel--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. Update ivy-last for non-exiting ivy-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. Use
read-number. Update ivy-last state for ivy-call.
(counsel-kmacro-action-execute-after-prompt): Improve docstring.
Fix current-prefix-arg usage and let ivy-current-prefix-arg override
it. Use read-number, read-string, and format-prompt. Avoid kmacro
destructuring via counsel--kmacro-exec.
Fixes #3066.1 parent 7a0d554 commit 6f10460Copy full SHA for 6f10460
File tree
Expand file treeCollapse file tree
1 file changed
+201
-182
lines changedOpen diff view settings
Filter options
Expand file treeCollapse file tree
1 file changed
+201
-182
lines changedOpen diff view settings
0 commit comments