[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 79f9cda 165/272: counsel-ag: Fix escaping problem
From: |
Oleh Krehel |
Subject: |
[elpa] master 79f9cda 165/272: counsel-ag: Fix escaping problem |
Date: |
Mon, 25 Apr 2016 10:13:23 +0000 |
branch: master
commit 79f9cdab81526246018642421b3b0f144991b1d6
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
counsel-ag: Fix escaping problem
Before this it is not possible to pass the string "string1\|string2" to
ag, because inputing string1\|string2 gets translated into
"string1\\|string2" via %S.
Instead I use %s and shell-quote-argument to take care of escaping for
the command line, which fixes the issue for me.
Please test.
Also see https://github.com/syl20bnr/spacemacs/issues/5378
---
counsel.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index 0d062c1..f1ede40 100644
--- a/counsel.el
+++ b/counsel.el
@@ -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
- [elpa] master f647bca 136/272: Simplify the ivy-format-function interface, (continued)
- [elpa] master f647bca 136/272: Simplify the ivy-format-function interface, Oleh Krehel, 2016/04/25
- [elpa] master c2b330b 091/272: doc/ivy.org: Add @vindex and @kindex automatically, Oleh Krehel, 2016/04/25
- [elpa] master 4c99ec6 107/272: counsel.el: Shuffle functions, Oleh Krehel, 2016/04/25
- [elpa] master 0fd6a75 142/272: Move switch-to-buffer to :display-transformer-fn, Oleh Krehel, 2016/04/25
- [elpa] master f5a21db 157/272: ivy.el: define setq-local and defvar-local unless defined, Oleh Krehel, 2016/04/25
- [elpa] master 71644d9 190/272: ivy.el (ivy-read): Remove code that sets action index to 1, Oleh Krehel, 2016/04/25
- [elpa] master 220fd38 079/272: doc/ivy.org: Improve the markup, Oleh Krehel, 2016/04/25
- [elpa] master 50f3092 169/272: counsel.el (counsel--async-sentinel): Start refactor, Oleh Krehel, 2016/04/25
- [elpa] master 41b8b0d 113/272: ivy.el (ivy-occur): Add a warning, Oleh Krehel, 2016/04/25
- [elpa] master b39e449 228/272: counsel.el (counsel-ag-map): Add, Oleh Krehel, 2016/04/25
- [elpa] master 79f9cda 165/272: counsel-ag: Fix escaping problem,
Oleh Krehel <=
- [elpa] master f1c7233 164/272: swiper.el (swiper-occur): Bind ivy--regex-function, Oleh Krehel, 2016/04/25
- [elpa] master 1de78f3 160/272: Improve window handling for ivy-occur, Oleh Krehel, 2016/04/25
- [elpa] master c90784d 087/272: doc/ivy.org: Update, Oleh Krehel, 2016/04/25
- [elpa] master d085765 146/272: ivy.el (ivy-switch-buffer): Don't fall back to switch-to-buffer, Oleh Krehel, 2016/04/25
- [elpa] master be06ae0 163/272: swiper.el: Add docstring, Oleh Krehel, 2016/04/25
- [elpa] master 587526e 138/272: counsel.el (counsel-git-grep-transformer): New defun, Oleh Krehel, 2016/04/25
- [elpa] master d40bdab 134/272: doc/ivy.org: Fix typo, Oleh Krehel, 2016/04/25
- [elpa] master 1c45b29 150/272: ivy-occur-mode: new commands on "j", "k", "c", Oleh Krehel, 2016/04/25
- [elpa] master c68d2cc 189/272: ivy.el (ivy-thing-at-point): Try ffap-file-at-point, Oleh Krehel, 2016/04/25
- [elpa] master d6b18f0 151/272: ivy.el (ivy-occur-press): Pulse no longer, Oleh Krehel, 2016/04/25