]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-ag): Add dir prompt for "C-u"
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 11 Mar 2016 16:01:13 +0000 (17:01 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 11 Mar 2016 16:01:13 +0000 (17:01 +0100)
Fixes #429

counsel.el

index 899e5e0a039ae37772ad91223563731319a140c5..9a0b95a879994cb57c7c55794f5f719b76630dba 100644 (file)
@@ -1289,7 +1289,10 @@ command. %S will be replaced by the regex string. The default is
 (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)
+  (interactive
+   (list nil
+         (when current-prefix-arg
+           (read-directory-name "ag in directory: "))))
   (setq counsel--git-grep-dir (or initial-directory default-directory))
   (ivy-read (funcall counsel-prompt-function "ag")
             'counsel-ag-function