[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0312d5e 259/348: Make counsel-ag support limiting in files
From: |
Oleh Krehel |
Subject: |
[elpa] master 0312d5e 259/348: Make counsel-ag support limiting in files. |
Date: |
Sat, 8 Apr 2017 11:04:11 -0400 (EDT) |
branch: master
commit 0312d5e1cc1784d9b196bc862a90d151fc8d80a9
Author: Yevgnen Koh <address@hidden>
Commit: Yevgnen Koh <address@hidden>
Make counsel-ag support limiting in files.
This is be done by detecting " -- " in extra-ag-args after
prompting, since ag supports " -- pattern file1 file2" style
of searching.
---
counsel.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/counsel.el b/counsel.el
index a40d29d..33e6c1a 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1682,10 +1682,18 @@ If non-nil, EXTRA-AG-ARGS string is appended to
BASE-CMD."
(regex (counsel-unquote-regex-parens
(setq ivy--old-re
(ivy--regex string)))))
- (let ((ag-cmd (format base-cmd
- (concat extra-ag-args
- " -- "
- (shell-quote-argument regex)))))
+ (let* ((args-end (string-match " -- " extra-ag-args))
+ (file (if args-end
+ (substring-no-properties extra-ag-args (+ args-end 3))
+ ""))
+ (extra-ag-args (if args-end
+ (substring-no-properties extra-ag-args 0
args-end)
+ extra-ag-args))
+ (ag-cmd (format counsel-ag-base-command
+ (concat extra-ag-args
+ " -- "
+ (shell-quote-argument regex)
+ file))))
(if (file-remote-p default-directory)
(split-string (shell-command-to-string ag-cmd) "\n" t)
(counsel--async-command ag-cmd)
- [elpa] master 2f6b67a 221/348: counsel.el (counsel-pt): Add initial-input arg, (continued)
- [elpa] master 2f6b67a 221/348: counsel.el (counsel-pt): Add initial-input arg, Oleh Krehel, 2017/04/08
- [elpa] master 085b0f2 218/348: Fix file name completion for when initial-input is a file name, Oleh Krehel, 2017/04/08
- [elpa] master 823d86c 224/348: counsel.el (counsel-grep): Quote :preselect, Oleh Krehel, 2017/04/08
- [elpa] master c8be397 222/348: update 'counsel-bookmark' with the ability to create, edit, and delete bookmarks, Oleh Krehel, 2017/04/08
- [elpa] master 45834cc 231/348: ivy.el (ivy--reset-state): file-name-directory can return nil, Oleh Krehel, 2017/04/08
- [elpa] master aacba19 229/348: ivy.el (ivy--directory-done): Check if ivy-text is a proper dir, Oleh Krehel, 2017/04/08
- [elpa] master b1f587d 233/348: ivy.el (ivy--directory-done): Fix "RET" on no input, Oleh Krehel, 2017/04/08
- [elpa] master 5190412 234/348: Add `counsel-rg`, Oleh Krehel, 2017/04/08
- [elpa] master 92f2be5 247/348: Fix typo in ivy-read docstring, Oleh Krehel, 2017/04/08
- [elpa] master b99f6de 238/348: ivy.el (ivy--directory-done): Fix when ivy-text exists, Oleh Krehel, 2017/04/08
- [elpa] master 0312d5e 259/348: Make counsel-ag support limiting in files.,
Oleh Krehel <=
- [elpa] master eddf427 261/348: counsel.el (counsel-ag): Fix byte-compile warning, Oleh Krehel, 2017/04/08
- [elpa] master bb4814a 262/348: Fix counsel-ag support limiting in files, Oleh Krehel, 2017/04/08
- [elpa] master 4232088 265/348: Don't claim `swiper' provides `ivy-mode', Oleh Krehel, 2017/04/08
- [elpa] master ee0d9e3 275/348: ivy.el (ivy--reset-state): Simplify, Oleh Krehel, 2017/04/08
- [elpa] master abdbfa7 273/348: counsel.el: Add counsel-org-agenda-headlines, Oleh Krehel, 2017/04/08
- [elpa] master 482c3e9 279/348: counsel.el (counsel-ace-link): Use `cdr' for action., Oleh Krehel, 2017/04/08
- [elpa] master e4c248a 278/348: doc/ivy.org: Update package names in ELPA/MELPA, Oleh Krehel, 2017/04/08
- [elpa] master 6e6738c 294/348: counsel.el (counsel-git-grep-cmd-default): Use '%s' quoting, Oleh Krehel, 2017/04/08
- [elpa] master d4e5d79 290/348: counsel.el (counsel-package): Fix sorting issue, Oleh Krehel, 2017/04/08
- [elpa] master 15f89f7 295/348: ivy.el (ivy-minibuffer-map): Bind "C-v" and scroll-up-command, Oleh Krehel, 2017/04/08