branch: master
commit 4af5c2e4e83f51da91675b0de7301b09c4b24b2c
Author: André Peric Tavares <andre.peric.tava...@gmail.com>
Commit: André Peric Tavares <andre.peric.tava...@gmail.com>
    Add `counsel-locate-cmd-mdfind`
    
    OS X users might want to use `mdfind` instead of `locate`. The added 
function `counsel-locate-cmd-mdfind` can be used to accomplish that.
---
 counsel.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 266746d..4b229de 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1062,7 +1062,8 @@ string - the full shell command to run."
   :group 'ivy
   :type '(choice
           (const :tag "Default" counsel-locate-cmd-default)
-          (const :tag "No regex" counsel-locate-cmd-noregex)))
+          (const :tag "No regex" counsel-locate-cmd-noregex)
+          (const :tag "mdfind" counsel-locate-cmd-mdfind)))
 
 (ivy-set-actions
  'counsel-locate
@@ -1098,6 +1099,10 @@ string - the full shell command to run."
 (defun counsel-locate-cmd-noregex (input)
   "Return a shell command based on INPUT."
   (format "locate -i '%s'" input))
+  
+(defun counsel-locate-cmd-mdfind (input)
+  "Return a shell command based on INPUT."
+  (format "mdfind -name '%s'" input))
 
 (defun counsel-locate-function (input)
   (if (< (length input) 3)

Reply via email to