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

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

[elpa] master 0f141f5 18/31: counsel.el (counsel-git-grep): Add optional


From: Oleh Krehel
Subject: [elpa] master 0f141f5 18/31: counsel.el (counsel-git-grep): Add optional initial-input
Date: Fri, 01 May 2015 14:28:56 +0000

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

    counsel.el (counsel-git-grep): Add optional initial-input
    
    * counsel.el (counsel-git-grep): Update.
    
    Fixes #66
---
 counsel.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/counsel.el b/counsel.el
index f41608d..27825fe 100644
--- a/counsel.el
+++ b/counsel.el
@@ -219,7 +219,7 @@
         (setq ivy--full-length (counsel-git-grep-count ivy-text)))
       (split-string res "\n" t))))
 
-(defun counsel-git-grep ()
+(defun counsel-git-grep (&optional initial-input)
   "Grep for a string in the current git repository."
   (interactive)
   (unwind-protect
@@ -236,7 +236,8 @@
                                           (setq swiper--window 
(selected-window))
                                           (swiper--cleanup)
                                           (swiper--add-overlays (ivy--regex 
ivy-text)))))
-              (val (ivy-read "pattern: " 'counsel-git-grep-function)))
+              (val (ivy-read "pattern: " 'counsel-git-grep-function
+                             :initial-input initial-input)))
          (when val
            (funcall ivy--persistent-action val)))
     (swiper--cleanup)))



reply via email to

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