[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c9235c8 04/54: counsel-locate should use '' for the regex
From: |
Oleh Krehel |
Subject: |
[elpa] master c9235c8 04/54: counsel-locate should use '' for the regex |
Date: |
Tue, 29 Sep 2015 14:09:47 +0000 |
branch: master
commit c9235c8b765998894e4f6756671bd9247ba99c95
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel-locate should use '' for the regex
* counsel.el (counsel-unquote-regex-parens): New defun.
(counsel-locate-function): Update.
(counsel-ag-function): Update.
Fixes #194
---
counsel.el | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/counsel.el b/counsel.el
index 0d75da1..2d41766 100644
--- a/counsel.el
+++ b/counsel.el
@@ -470,14 +470,21 @@ Skip some dotfiles unless `ivy-text' requires them."
'(("x" counsel-locate-action-extern "xdg-open")
("d" counsel-locate-action-dired "dired")))
+(defun counsel-unquote-regex-parens (str)
+ (replace-regexp-in-string
+ "\\\\)" ")"
+ (replace-regexp-in-string
+ "\\\\(" "("
+ str)))
+
(defun counsel-locate-function (str &rest _u)
(if (< (length str) 3)
(counsel-more-chars 3)
(counsel--async-command
- (concat "locate "
- (mapconcat #'identity counsel-locate-options " ")
- " "
- (ivy--regex str)))
+ (format "locate %s '%s'"
+ (mapconcat #'identity counsel-locate-options " ")
+ (counsel-unquote-regex-parens
+ (ivy--regex str))))
'("" "working...")))
;;;###autoload
@@ -872,11 +879,7 @@ 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 (replace-regexp-in-string
- "\\\\)" ")"
- (replace-regexp-in-string
- "\\\\(" "("
- (ivy--regex string)))))
+ (let ((regex (counsel-unquote-regex-parens (ivy--regex string))))
(counsel--async-command
(format "ag --noheading --nocolor %S" regex))
nil)))
- [elpa] master updated (af81566 -> 8b73497), Oleh Krehel, 2015/10/07
- [elpa] master c9235c8 04/54: counsel-locate should use '' for the regex,
Oleh Krehel <=
- [elpa] master 432bc7e 10/54: Set line-spacing to 0 in the minibuffer, Oleh Krehel, 2015/10/07
- [elpa] master 39dfc80 05/54: Fix :dynamic-collection not being sorted, Oleh Krehel, 2015/10/07
- [elpa] master 970b984 01/54: Fix up ivy-recentf and ivy-switch-buffer window-wise, Oleh Krehel, 2015/10/07
- [elpa] master b844b69 19/54: ivy.el (ivy--format-minibuffer-line): Use add-face-text-property, Oleh Krehel, 2015/10/07
- [elpa] master c78a306 09/54: ivy.el (ivy-kill-ring-save): Add and bind to "M-w", Oleh Krehel, 2015/10/07
- [elpa] master 6bf2913 25/54: Declare some SLIME functions, Oleh Krehel, 2015/10/07
- [elpa] master 5db65db 34/54: swiper.el (swiper--ivy): Fix compiler warning, Oleh Krehel, 2015/10/07
- [elpa] master 05d5e63 02/54: (counsel-locate): Allow customizing locate options, Oleh Krehel, 2015/10/07
- [elpa] master 33fa81e 14/54: counsel.el (counsel-jedi): New command, Oleh Krehel, 2015/10/07
- [elpa] master 435f2b6 38/54: Add work-around for minibuffer not re-sizing for many frames, Oleh Krehel, 2015/10/07