Open deadcombo opened 6 months ago
Part of the function consult-notes-org-roam-mode
involves adding these when the minor mode is activated:
(add-to-list 'consult-notes-all-sources 'consult-notes-org-roam--nodes 'append)
(add-to-list 'consult-notes-all-sources 'consult-notes-org-roam--refs 'append)
Have you tried adding advice to the minor mode to remove from consult-notes-all-sources
the directory containing the daily files? This won't affect your search of all notes since that uses the value of org-roam-directory
Would you give me a hand with that?
I had a go at:
(advice-add 'consult-notes-org-roam--nodes :after '(remove org-roam-dailies-directory '(consult-notes-all-sources)))
But that doesn't seem to do it. The output of consult-notes-org-roam--nodes
is a bit more than I can handle.
I don't have org-roam to test this but @deadcombo I think what you'll need to do is modify the lambdas for :items to filter out nodes or refs based on their file location. So you'll want to swap in this:
:items ,(lambda ()
(let* ((nodes (org-roam-node-read--completions))
(filtered-nodes (seq-filter (lambda (node)
(not (string-prefix-p org-roam-dailies-directory
(org-roam-node-file (cdr node)))))
nodes)))
(mapcar #'org-roam-node-title (mapcar #'cdr filtered-nodes))))
for what is there in consult-notes-org-roam--nodes
. You'll need to apply a similar modification to the consult-notes-org-roam--refs
var if refs are also stored in daily files you wish to exclude.
Hello,
I use the
org-roam
configuration you demonstrate in the readme.I use
org-roam-dailies
a lot which means I have hundreds of daily files. This is cumbersome when callingconsult-notes
, the files are named with dates and there are a lot of them. How can I excludeorg-roam-dailies-directory
from theconsult-notes
command? I'd still like them to be covered byconsult-notes-search-all-notes
, just not theconsult-notes
.