[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f4bd3a4 055/167: counsel.el (counsel-ag): Add initial-dire
From: |
Oleh Krehel |
Subject: |
[elpa] master f4bd3a4 055/167: counsel.el (counsel-ag): Add initial-directory |
Date: |
Tue, 08 Dec 2015 10:49:52 +0000 |
branch: master
commit f4bd3a49bd009fe2e20bc2cfc83616bc9168a64b
Author: Jon Miller <address@hidden>
Commit: Jon Miller <address@hidden>
counsel.el (counsel-ag): Add initial-directory
Support alternative initial directory which helps other packages call
this function with their unique starting directory.
---
counsel.el | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/counsel.el b/counsel.el
index 5d5263b..25f1f44 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1040,18 +1040,19 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
"Grep in the current directory for STRING."
(if (< (length string) 3)
(counsel-more-chars 3)
- (let ((regex (counsel-unquote-regex-parens
+ (let ((default-directory counsel--git-grep-dir)
+ (regex (counsel-unquote-regex-parens
(setq ivy--old-re
(ivy--regex string)))))
(counsel--async-command
(format "ag --noheading --nocolor %S" regex))
nil)))
-(defun counsel-ag (&optional initial-input)
+(defun counsel-ag (&optional initial-input initial-directory)
"Grep for a string in the current directory using ag.
INITIAL-INPUT can be given as the initial minibuffer input."
(interactive)
- (setq counsel--git-grep-dir default-directory)
+ (setq counsel--git-grep-dir (or initial-directory default-directory))
(ivy-read "ag: " 'counsel-ag-function
:initial-input initial-input
:dynamic-collection t
- [elpa] master 4045349 032/167: ivy.el (ivy-use-virtual-buffers): Update docstring, (continued)
- [elpa] master 4045349 032/167: ivy.el (ivy-use-virtual-buffers): Update docstring, Oleh Krehel, 2015/12/08
- [elpa] master f9df75e 037/167: ivy.el (ivy-index-functions-alist): New variable, Oleh Krehel, 2015/12/08
- [elpa] master 6e3c692 029/167: Fix ivy-state-preselect for file name completion, Oleh Krehel, 2015/12/08
- [elpa] master c69b4b6 033/167: ivy.el (ivy-last): Update docstring, Oleh Krehel, 2015/12/08
- [elpa] master b6d476a 042/167: ivy.el (ivy--recompute-index): Fixup, Oleh Krehel, 2015/12/08
- [elpa] master 83f704b 039/167: ivy-hydra.el (hydra-ivy): Make the docstring a rectangle, Oleh Krehel, 2015/12/08
- [elpa] master b06daca 040/167: ivy.el (ivy-virtual-abbreviate): New defcustom, Oleh Krehel, 2015/12/08
- [elpa] master c99956a 047/167: Fix window selection in counsel-locate, Oleh Krehel, 2015/12/08
- [elpa] master fa0d04c 038/167: Move setq ivy--index to ivy--recompute-index, Oleh Krehel, 2015/12/08
- [elpa] master e5105ef 054/167: Don't re-anchor to matching old candidate if flx is on, Oleh Krehel, 2015/12/08
- [elpa] master f4bd3a4 055/167: counsel.el (counsel-ag): Add initial-directory,
Oleh Krehel <=
- [elpa] master 79924dc 051/167: swiper.el (swiper--re-builder): Fix "^a" -> "^" case, Oleh Krehel, 2015/12/08
- [elpa] master 2404db1 053/167: Add feedback for long-running async processes, Oleh Krehel, 2015/12/08
- [elpa] master d4d53d8 059/167: ivy.el (ivy-partial): Fix for fuzzy completion, Oleh Krehel, 2015/12/08
- [elpa] master 2ae7d74 058/167: Fix the count in user-specified counsel-git-grep, Oleh Krehel, 2015/12/08
- [elpa] master fd19ab1 062/167: Add a test for the perfect match logic, Oleh Krehel, 2015/12/08
- [elpa] master 2386277 060/167: ivy.el (ivy-resume): Pass caller, Oleh Krehel, 2015/12/08
- [elpa] master 607fd1f 061/167: Bring back the lost perfect match logic, Oleh Krehel, 2015/12/08
- [elpa] master f0acebd 063/167: Fix Custom menus, Oleh Krehel, 2015/12/08
- [elpa] master f6dd9cd 066/167: ivy.el (ivy-alt-done): Fix up last commit, Oleh Krehel, 2015/12/08
- [elpa] master a11c978 068/167: ivy-immediate-done should use ivy--directory, Oleh Krehel, 2015/12/08