Open arenzana opened 4 years ago
I found this issue whilst attempting to use ripgrep-all to search pdf with deadgrep. I have just set the variable deadgrep-executable to rga seems to be working fine so far.
@Wilfred, Although it's true you can set the deadgrep-executable
user-option to "rga" it would be nice to be able to either be able to:
deadgrep-executable
from within a deadgrep-mode
buffer. Which would allow anyone to change the executable for a given buffer only, or I tried the following code that almost does the job of providing a ripgrep-all even when the deadgrep-executable is set to ripgrep. Unfortunately the hook activates it for the remainder of the Emacs session and it affects all buffers:
(defun deadgrep-all-setup ()
"Use rga in deadgrep buffer."
(setq-local deadgrep-executable "rga"))
(defun deadgrep-all (search-term)
"Search with rga."
(interactive (list (deadgrep--read-search-term)))
(let ((deadgrep-executable "rga"))
(add-hook 'deadgrep-mode-hook 'deadgrep-all-setup)
(deadgrep search-term)))
The advantage of being able to select ripgrep-all just sometimes, is that ripgrep is faster. Some people may want to use ripgrep-all just sometimes, and would't want to switch to ripgrep-all for all of their searches.
I LOVE deadgrep and use it pretty much daily. One thing I just recently found was this project: https://github.com/phiresky/ripgrep-all. It allows for search inside all type of file formats (including pdf, which is the one I'm interested in particularly).
Not sure this is technically possible or worth the time, but ripgrep-all as an alternative engine would be amazing!