]> code.delx.au - gnu-emacs-elpa/blobdiff - counsel.el
counsel-ag: Fix escaping problem
[gnu-emacs-elpa] / counsel.el
index 0d062c1c2eb87a35632df9e133a893ae712fb02c..f1ede40921897541305cded5822f818b8e0de086 100644 (file)
@@ -1185,7 +1185,7 @@ INITIAL-INPUT can be given as the initial minibuffer input."
 
 ;;* Grep
 ;;** `counsel-ag'
-(defcustom counsel-ag-base-command "ag --vimgrep %S"
+(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\"."
@@ -1201,7 +1201,7 @@ command. %S will be replaced by the regex string. The default is
                   (setq ivy--old-re
                         (ivy--regex string)))))
       (counsel--async-command
-       (format counsel-ag-base-command regex))
+       (format counsel-ag-base-command (shell-quote-argument regex)))
       nil)))
 
 ;;;###autoload