0

I am trying to setup a way to systematically search through all my org-roam notes and I came across the following code that uses consult-ripgrep:

(defun bms/org-roam-rg-search ()
  "Search org-roam directory using consult-ripgrep. With live-preview."
  (interactive)
  (let ((consult-ripgrep-command "rg --multiline --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
    (consult-ripgrep org-roam-directory)))

I am using doom emacs and I setup the above code in my config.el file. However, when I run M-x bms/org-roam-rg-search and type in anything, it asks me about 'matched required' as shown: enter image description here

I am confused about what I am doing incorrect as it is searching the correct folder where my notes are stored and I am typing in keywords that exist in the directory but nothing shows up. When I open an eshell terminal and type rg test I get several matches but consult-ripgrep asking me for match required even though I typed in a string.

1 Answers1

0

So I looked at the consul-ripgrep and consul-grep documentation and I'm still not entirely sure how the INITIAL parameter is meant to be used however I took your code and just added an empty string as the last parameter to the call to consult-ripgrep and it seems to be working now:

(defun local/org-roam-rg-search ()
  "Search org-roam directory using consult-ripgrep. With live-preview."
  (interactive)
  (let ((consult-ripgrep-command "rg --multiline --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
  (consult-ripgrep org-roam-directory "")))
trollybus
  • 1
  • 2
  • I made the change as you did and I still get the same issue as above. Now that I look closely, when I type `M-x consult-ripgrep-command` nothing shows up. But `M-x consult-ripgrep` does show up. – user39286 Nov 06 '22 at 15:18