[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6026caf 174/272: counsel.el (counsel-locate-cmd-es): Add
From: |
Oleh Krehel |
Subject: |
[elpa] master 6026caf 174/272: counsel.el (counsel-locate-cmd-es): Add |
Date: |
Mon, 25 Apr 2016 10:13:24 +0000 |
branch: master
commit 6026caf0d4948a38dbb748579c02dc5c3a8a7e1f
Author: justbur <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-locate-cmd-es): Add
es is the shell version of the everything utility for ms windows, which
functions like locate.
Fixes #426
---
counsel.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/counsel.el b/counsel.el
index 26d4b83..26ee0eb 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1170,9 +1170,13 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer
during completion."
(make-obsolete-variable 'counsel-locate-options 'counsel-locate-cmd "0.7.0")
-(defcustom counsel-locate-cmd (if (eq system-type 'darwin)
- 'counsel-locate-cmd-noregex
- 'counsel-locate-cmd-default)
+(defcustom counsel-locate-cmd (cond ((eq system-type 'darwin)
+ 'counsel-locate-cmd-noregex)
+ ((and (eq system-type 'windows-nt)
+ (executable-find "es.exe"))
+ 'counsel-locate-cmd-es)
+ (t
+ 'counsel-locate-cmd-default))
"The function for producing a locate command string from the input.
The function takes a string - the current input, and returns a
@@ -1181,7 +1185,8 @@ string - the full shell command to run."
:type '(choice
(const :tag "Default" counsel-locate-cmd-default)
(const :tag "No regex" counsel-locate-cmd-noregex)
- (const :tag "mdfind" counsel-locate-cmd-mdfind)))
+ (const :tag "mdfind" counsel-locate-cmd-mdfind)
+ (const :tag "everything" counsel-locate-cmd-es)))
(ivy-set-actions
'counsel-locate
@@ -1224,6 +1229,12 @@ string - the full shell command to run."
"Return a shell command based on INPUT."
(format "mdfind -name '%s'" input))
+(defun counsel-locate-cmd-es (input)
+ "Return a shell command based on INPUT."
+ (format "es.exe -i -r %s"
+ (counsel-unquote-regex-parens
+ (ivy--regex input))))
+
(defun counsel-locate-function (input)
(if (< (length input) 3)
(counsel-more-chars 3)
- [elpa] master 8f527d7 149/272: ivy.el (ivy-next-history-element): No "\\_<" for dynamic-collection, (continued)
- [elpa] master 8f527d7 149/272: ivy.el (ivy-next-history-element): No "\\_<" for dynamic-collection, Oleh Krehel, 2016/04/25
- [elpa] master 265bf49 251/272: counsel.el: Fix compile warning, Oleh Krehel, 2016/04/25
- [elpa] master 7cf13a7 186/272: counsel.el (counsel-linux-app): New command, Oleh Krehel, 2016/04/25
- [elpa] master 31a2f86 238/272: counsel.el (counsel-expression-history): enable-recursive-minibuffers, Oleh Krehel, 2016/04/25
- [elpa] master 5299c0a 099/272: doc/ivy.texi: Re-export from previous commit, Oleh Krehel, 2016/04/25
- [elpa] master a50f668 111/272: counsel.el (counsel-locate-options): Make obsolete, Oleh Krehel, 2016/04/25
- [elpa] master 327b85a 239/272: counsel.el (counsel-expression-history): Add docstring, Oleh Krehel, 2016/04/25
- [elpa] master b6f3e45 271/272: Rename swiper -> ivy, Oleh Krehel, 2016/04/25
- [elpa] master 9aa1f5c 156/272: counsel.el (counsel-mode-map): Add counsel-M-x, Oleh Krehel, 2016/04/25
- [elpa] master 6757030 225/272: counsel-grep now works with ivy-occur-revert-buffer, Oleh Krehel, 2016/04/25
- [elpa] master 6026caf 174/272: counsel.el (counsel-locate-cmd-es): Add,
Oleh Krehel <=
- [elpa] master 7ed5b06 119/272: ivy.el (ivy--preselect-index): Don't use regexp-quote, Oleh Krehel, 2016/04/25
- [elpa] master dcf4957 123/272: counsel.el (counsel--async-command): Add sentinel and filter args, Oleh Krehel, 2016/04/25
- [elpa] master 53ca6ed 065/272: ivy.el (ivy-do-completion-in-region): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master ca2b47f 240/272: Add timing information to async commands, Oleh Krehel, 2016/04/25
- [elpa] master d544427 093/272: swiper.el (swiper--re-builder): Replace \t with 4 spaces, Oleh Krehel, 2016/04/25
- [elpa] master 1f3ea7d 095/272: ivy.el (ivy-next-history-element): Handle "M-n M-n" better, Oleh Krehel, 2016/04/25
- [elpa] master ab3ad4e 085/272: doc/ivy.org: Add more CUSTOM_ID, Oleh Krehel, 2016/04/25
- [elpa] master 725e19a 170/272: counsel.el (counsel-ag-occur): Add, Oleh Krehel, 2016/04/25
- [elpa] master ccbf9ef 204/272: Improve counsel-async initial anchoring, Oleh Krehel, 2016/04/25
- [elpa] master 2fb8d86 260/272: ivy.el (ivy-done): Allow ivy-dispatching-done to exit with no cands, Oleh Krehel, 2016/04/25