[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 04e7942 130/395: counsel-kmacro: Small improv
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 04e7942 130/395: counsel-kmacro: Small improvements to functions and documentation strings. |
Date: |
Thu, 25 Feb 2021 08:31:47 -0500 (EST) |
branch: externals/ivy-hydra
commit 04e79421d45fe1b1f6b808a1d723167775b35b0b
Author: dude <ej32u@protonmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel-kmacro: Small improvements to functions and documentation strings.
- Use clearer wording.
- Use `delq` instead of `remove`.
- Use `user-error` instead of `message` when no macros defined.
- Slightly reorganize `counsel-kmacro` to use less logical functions.
---
counsel.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/counsel.el b/counsel.el
index 5505b2e..8cb57ff 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5323,17 +5323,17 @@ the counter's format and initial value.
One can use actions to copy the counter format or initial counter
value of a macro, using them for a new macro."
(interactive)
- (if (and (eq last-kbd-macro nil) (eq kmacro-ring nil))
- (message "counsel-kmacro: No keyboard macros defined.")
- (ivy-read
- (concat "Execute macro (counter at "
- (number-to-string (or kmacro-initial-counter-value
kmacro-counter))
- "): ")
- (counsel--kmacro-candidates)
- :keymap counsel-kmacro-map
- :require-match t
- :action #'counsel-kmacro-action-run
- :caller 'counsel-kmacro)))
+ (if (or last-kbd-macro kmacro-ring)
+ (ivy-read
+ (concat "Execute macro (counter at "
+ (number-to-string (or kmacro-initial-counter-value
kmacro-counter))
+ "): ")
+ (counsel--kmacro-candidates)
+ :keymap counsel-kmacro-map
+ :require-match t
+ :action #'counsel-kmacro-action-run
+ :caller 'counsel-kmacro)
+ (user-error "No keyboard macros defined")))
(ivy-configure 'counsel-kmacro
:format-fn #'counsel--kmacro-format-function)
@@ -5380,10 +5380,10 @@ This is a combination of `kmacro-ring' and, together in
a list, `last-kbd-macro'
(kmacro-call-macro (or current-prefix-arg 1) t nil kmacro-keys)))
(defun counsel-kmacro-action-delete-kmacro (x)
- "Delete a keyboard macro within `counsel-kmacro'.
+ "Delete a keyboard macro from within `counsel-kmacro'.
-Either remove a macro from `kmacro-ring', or pop the head of the
-`kmacro-ring' and set `last-kbd-macro' to that value."
+Either delete a macro from `kmacro-ring', or set `last-kbd-macro'
+to the popped head of the ring."
(let ((actual-macro (cdr x)))
(if (eq (nth 0 actual-macro) last-kbd-macro)
(setq last-kbd-macro
@@ -5393,7 +5393,7 @@ Either remove a macro from `kmacro-ring', or pop the head
of the
(if (listp prev-macro)
(nth 0 prev-macro)
prev-macro))))
- (setq kmacro-ring (remove actual-macro kmacro-ring)))))
+ (setq kmacro-ring (delq actual-macro kmacro-ring)))))
(defun counsel-kmacro-action-copy-initial-counter-value-for-new-macro (x)
"Set `kmacro-initial-counter-value' to an existing keyboard macro's original
counter value.
- [elpa] externals/ivy-hydra 721a3b7 371/395: Make ivy-mode more careful when setting globals, (continued)
- [elpa] externals/ivy-hydra 721a3b7 371/395: Make ivy-mode more careful when setting globals, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5de2662 372/395: counsel.el (counsel-linux-app): Clean up env part of the cmd, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d2891aa 376/395: Percent-encode counsel-search query, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f90c018 389/395: counsel.el (counsel-grep-like-occur): Use ivy-text as backup, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3c53de1 390/395: * .elpaignore: New file., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 496a5e2 105/395: counsel.el: Fix ivy-occur ivy--regex-function bug, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6b4f43a 111/395: ivy.el (ivy--update-minibuffer): Return string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0ce0bf1 123/395: counsel.el (counsel-evil-marks): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e05bc45 108/395: ivy.el (ivy--recompute-index): Take one less argument, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 723e4d6 126/395: counsel.el: Point to evil-common for evil-global-marker-p declaration., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04e7942 130/395: counsel-kmacro: Small improvements to functions and documentation strings.,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 4d161cc 128/395: counsel-kmacro: Clarify copying of values for next macro user defines., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 16298bc 137/395: ivy.el (ivy-read-action-format-function): Upgrade to defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 269583d 125/395: counsel.el (counsel-locate-cmd-es): Switch flags order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 098f8fe 133/395: swiper.el (swiper-isearch-toggle): Fix up, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b20a6db 135/395: counsel.el (counsel-recentf-candidates): Sort remote files better, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d1c3613 140/395: Fix ivy-{next, previous}-line-or-history when input is empty, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2229801 142/395: counsel.el (counsel-M-x-action): Trim left ^, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra af51ffd 139/395: ivy.el (ivy-read-action-ivy): Don't reset ivy-marked-candidates to nil, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8f3e589 138/395: counsel.el: Add "overwrite" action to counsel-bookmark, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6930d72 143/395: ivy.el (ivy--kill-current-candidate): Specialize and fix for buffers, Basil L. Contovounesios, 2021/02/25