[Top][All Lists]

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

[elpa] master 09848ca 013/272: Add cousel-ag-base-command var

From: Oleh Krehel
Subject: [elpa] master 09848ca 013/272: Add cousel-ag-base-command var
Date: Mon, 25 Apr 2016 10:13:13 +0000

branch: master
commit 09848cab2e21da142bd57e1a7d81d66546fc3920
Author: justbur <address@hidden>
Commit: justbur <address@hidden>

    Add cousel-ag-base-command var
    Allows the command run by counsel-ag-function to be customized. There
    are several reasons to allow this: The vimgrep option is a recent
    addition; on windows it's more convenient to use pt; and the user might
    want to customize ignored files.
 counsel.el |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 7df6c87..062d95c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1112,6 +1112,13 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
            (org-agenda-set-tags nil nil))
       (fset 'org-set-tags store))))
+(defcustom counsel-ag-base-command "ag --vimgrep %S"
+  "Format string to use in `cousel-ag-function' to construct the
+command. %S will be replaced by the regex string. The default is
+\"ag --vimgrep %S\"."
+  :type 'stringp
+  :group 'ivy)
 (defun counsel-ag-function (string &optional _pred &rest _unused)
   "Grep in the current directory for STRING."
   (if (< (length string) 3)
@@ -1121,7 +1128,7 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
                   (setq ivy--old-re
                         (ivy--regex string)))))
-       (format "ag --vimgrep %S" regex))
+       (format counsel-ag-base-command regex))

reply via email to

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