emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master b01108e 027/399: ivy.el (ivy-call): Call action with whole


From: Oleh Krehel
Subject: [elpa] master b01108e 027/399: ivy.el (ivy-call): Call action with whole marked list if it has a second arg
Date: Sat, 20 Jul 2019 14:56:41 -0400 (EDT)

branch: master
commit b01108e167ad26139535a516a056063d7ea4fff6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-call): Call action with whole marked list if it has a second arg
    
    Re #561
---
 ivy.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index f7a997f..6db8e00 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1312,8 +1312,14 @@ will be called for each element of this list.")
           (set-buffer (ivy-state-buffer ivy-last))
           (prog1 (unwind-protect
                       (if ivy-marked-candidates
-                          (dolist (c ivy-marked-candidates)
-                            (funcall action (substring c (length 
ivy-mark-prefix))))
+                          (let ((l (length ivy-mark-prefix)))
+                            (setq ivy-marked-candidates
+                                  (mapcar (lambda (s) (substring s l))
+                                          ivy-marked-candidates))
+                            (if (> (length (help-function-arglist action)) 1)
+                                (funcall action x ivy-marked-candidates)
+                              (dolist (c ivy-marked-candidates)
+                                (funcall action c))))
                         (funcall action x))
                    (ivy-recursive-restore))
             (unless (or (eq ivy-exit 'done)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]