From d718b1f106d721ea393fd4b2af1ef2f08dd548f6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 30 Aug 2021 22:18:13 -0500 Subject: Add `affe' --- lisp/acdw-consult.el | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lisp/acdw-consult.el') diff --git a/lisp/acdw-consult.el b/lisp/acdw-consult.el index e6995f5..58a2136 100644 --- a/lisp/acdw-consult.el +++ b/lisp/acdw-consult.el @@ -9,17 +9,26 @@ "Perform `consult-git-grep' if in a git project, otherwise `consult-ripgrep' if ripgrep is installed, otherwise `consult-grep'." (interactive "P") - (cond ((executable-find "rg") - (call-interactively #'consult-ripgrep)) - ((string-equal (vc-backend buffer-file-name) "Git") - (call-interactively #'consult-git-grep)) - (t (call-interactively #'consult-grep)))) + (call-interactively + (cond ((executable-find "rg") + (if (fboundp 'affe-grep) + #'affe-grep + #'consult-ripgrep)) + ((string-equal (vc-backend buffer-file-name) "Git") + #'consult-git-grep) + (t #'consult-grep)))) (defun acdw-consult/sensible-find (&optional arg) "Peform `consult-locate' if locate is installed, otehrwise `consult-find'." (interactive "P") - (cond ((executable-find "locate") (call-interactively #'consult-locate)) - (t (call-interactively #'consult-find)))) + (call-interactively + (cond ((executable-find "locate") + #'consult-locate) + ((fboundp 'affe-find) + (when (executable-find "fd") + (setq affe-find-command "fd -HI -t f")) + #'affe-find) + (t #'consult-find)))) ;; Orderless Regexp Compiler! -- from Consult Wiki (defun consult--orderless-regexp-compiler (input type) -- cgit 1.4.1-21-gabe81