Focus on ripgrep; remove ag, git-grep & grep support

We're focusing on ripgrep so we can iterate on search functionality in
Doom quicker. There is nothing the other search backends can do that
ripgrep can't. It is now a hard dependency for Doom.
This commit is contained in:
Henrik Lissner 2019-11-17 01:19:59 -05:00
parent 7a7b89ded1
commit a66872fe25
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 78 additions and 292 deletions

View file

@ -610,18 +610,12 @@ Uses the symbol at point or the current selection, if available."
(list (read-string
(format "Search load-path (default: %s): " query)
nil 'git-grep query))))
;; REVIEW Replace with deadgrep or ivy/helm interface when we drop ag/git-grep
;; support later
;; REVIEW Replace with deadgrep
(grep-find
(mapconcat
#'shell-quote-argument
(cond ((executable-find "rg")
`("rg" "-L" "--search-zip" "--no-heading" "--color=never"
,query ,@(cl-remove-if-not #'file-directory-p load-path)))
((executable-find "ag")
`("ag" "--search-zip" "--nogroup" "--nocolor"
,query ,@(cl-remove-if-not #'file-directory-p load-path)))
((user-error "This command requires ripgrep or the_silver_searcher to be installed on your system")))
(append (list "rg" "-L" "--search-zip" "--no-heading" "--color=never" query)
(cl-remove-if-not #'file-directory-p load-path))
" ")))
;; TODO factor our the duplicate code between this and the above
@ -639,18 +633,13 @@ Uses the symbol at point or the current selection, if available."
(list (read-string
(format "Search load-path (default: %s): " query)
nil 'git-grep query))))
(unless (executable-find "rg")
(user-error "Can't find ripgrep on your system"))
(require 'elisp-refs)
;; REVIEW Replace with deadgrep or ivy/helm interface when we drop ag/git-grep
;; support later
;; REVIEW Replace with deadgrep
(grep-find
(mapconcat
#'shell-quote-argument
(let ((search (elisp-refs--loaded-paths)))
(cond ((executable-find "rg")
`("rg" "-L" "--search-zip" "--no-heading" "--color=never"
,query ,@(cl-remove-if-not #'file-directory-p search)))
((executable-find "ag")
`("ag" "--search-zip" "--nogroup" "--nocolor"
,query ,@(cl-remove-if-not #'file-directory-p search)))
((user-error "This command requires ripgrep or the_silver_searcher to be installed on your system"))))
(append (list "rg" "-L" "--search-zip" "--no-heading" "--color=never" query)
(cl-remove-if-not #'file-directory-p (elisp-refs--loaded-paths)))
" ")))