[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 746e2c01c8 2/2: Always use the car of marked for acti
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 746e2c01c8 2/2: Always use the car of marked for action-transformer predicate |
Date: |
Wed, 17 Aug 2022 06:58:56 -0400 (EDT) |
branch: elpa/helm
commit 746e2c01c806c9e52ff75c3568dad90ca281b784
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Always use the car of marked for action-transformer predicate
---
helm-core.el | 15 +++++++--------
helm-source.el | 11 ++++++-----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/helm-core.el b/helm-core.el
index 98e8e6f37a..52d50155f3 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -2230,11 +2230,12 @@ when predicate helm-ff-candidates-lisp-p returns
non-nil:
(let* ((actions (helm-get-attr 'action source 'ignorefn))
(action-transformers (helm-get-attr 'action-transformer source))
(new-action (list (cons name fn)))
- (transformer (lambda (actions candidate)
- (cond ((funcall predicate candidate)
- (helm-append-at-nth
- actions new-action index))
- (t actions)))))
+ (transformer (lambda (actions _candidate)
+ (let ((candidate (car (helm-marked-candidates))))
+ (cond ((funcall predicate candidate)
+ (helm-append-at-nth
+ actions new-action index))
+ (t actions))))))
(when (functionp actions)
(helm-set-attr 'action (list (cons "Default action" actions)) source))
(when (or (symbolp action-transformers) (functionp action-transformers))
@@ -2397,9 +2398,7 @@ of (action-display . function)."
;; type so that the actions added by transformer fit with
;; all marked (previously we were looping on each marked
;; but it is too costly for the benefit it brings).
- (if marked
- (car marked)
- (helm-get-selection nil nil src)))
+ (car marked))
actions))))
(defun helm-get-current-source ()
diff --git a/helm-source.el b/helm-source.el
index a8ba121029..f97bff1fea 100644
--- a/helm-source.el
+++ b/helm-source.el
@@ -1046,11 +1046,12 @@ an eieio class."
(let* ((actions (slot-value source 'action))
(action-transformers (slot-value source 'action-transformer))
(new-action (list (cons name fn)))
- (transformer (lambda (actions candidate)
- (cond ((funcall predicate candidate)
- (helm-append-at-nth
- actions new-action index))
- (t actions)))))
+ (transformer (lambda (actions _candidate)
+ (let ((candidate (car (helm-marked-candidates))))
+ (cond ((funcall predicate candidate)
+ (helm-append-at-nth
+ actions new-action index))
+ (t actions))))))
(cond ((functionp actions)
(setf (slot-value source 'action) (list (cons "Default action"
actions))))
((listp actions)