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

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

[elpa] master 0efbf6e 055/272: Simplify the signature for :dynamic-colle


From: Oleh Krehel
Subject: [elpa] master 0efbf6e 055/272: Simplify the signature for :dynamic-collection functions
Date: Mon, 25 Apr 2016 10:13:16 +0000

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

    Simplify the signature for :dynamic-collection functions
    
    * ivy.el (ivy--reset-state): When given :dynamic-collection, assume the
      collection function only needs one argument - the string input.
    
    * counsel.el (counsel-ag-function):
    (counsel-locate-function):
    (counsel-grep-function):
    (counsel-recoll-function): Simplify arglist.
---
 counsel.el |    8 ++++----
 ivy.el     |    2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index c5ea288..ddf3d4f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -683,7 +683,7 @@ Update the minibuffer with the amount of lines collected 
every
     "\\\\(" "("
     str)))
 
-(defun counsel-locate-function (str &rest _u)
+(defun counsel-locate-function (str)
   (if (< (length str) 3)
       (counsel-more-chars 3)
     (counsel--async-command
@@ -1166,7 +1166,7 @@ command. %S will be replaced by the regex string. The 
default is
   :type 'stringp
   :group 'ivy)
 
-(defun counsel-ag-function (string &optional _pred &rest _unused)
+(defun counsel-ag-function (string)
   "Grep in the current directory for STRING."
   (if (< (length string) 3)
       (counsel-more-chars 3)
@@ -1214,7 +1214,7 @@ INITIAL-INPUT can be given as the initial minibuffer 
input."
                       (swiper--cleanup))
             :caller 'counsel-grep))
 
-(defun counsel-grep-function (string &optional _pred &rest _unused)
+(defun counsel-grep-function (string)
   "Grep in the current directory for STRING."
   (if (< (length string) 3)
       (counsel-more-chars 3)
@@ -1238,7 +1238,7 @@ INITIAL-INPUT can be given as the initial minibuffer 
input."
           (swiper--cleanup)
           (swiper--add-overlays (ivy--regex ivy-text)))))))
 
-(defun counsel-recoll-function (string &optional _pred &rest _unused)
+(defun counsel-recoll-function (string)
   "Grep in the current directory for STRING."
   (if (< (length string) 3)
       (counsel-more-chars 3)
diff --git a/ivy.el b/ivy.el
index fb251d1..9bc5fb3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1245,6 +1245,8 @@ This is useful for recursive `ivy-read'."
                  (setq initial-input nil))))
             ((eq collection 'internal-complete-buffer)
              (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers)))
+            (dynamic-collection
+             (setq coll (funcall collection ivy-text)))
             ((or (functionp collection)
                  (byte-code-function-p collection)
                  (vectorp collection)



reply via email to

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