aadi58002 · 2022-12-08 04:28
I have searched online a lot found a lot of ways to filter the list based on one keyword. Ex:-
(defun my/org-roam-filter-by-tag (tag-name)
(lambda (node)
(member tag-name (org-roam-node-tags node))))
(defun my/org-roam-list-notes-by-tag (tag-name)
(mapcar #'org-roam-node-file
(seq-filter
(my/org-roam-filter-by-tag tag-name)
(org-roam-node-list))))
But i have not found a way to just remove a single tag or a catagory from the list. I would like to hide the tag of
#dailies
org-roam files from the list as well as the file which have the catagroy of
@Groups
from the list.
I am aware that you can i can type !@Groups in the search bar to remove these entries but i do not want to type them out every time i open the org roam find node command and i want the default view to not contain these tags/catagory
paretoOptimalDev · 2022-12-09 02:44
Query org-roam.db for all node ids linked to the tag with an inner join to tags and return all nodes?
recursing-p · 2022-12-10 16:11
Couldn't you just do this?
`(not (member tag-name (org-roam-node-tags node)))`
aadi58002 · 2022-12-11 12:54
(defun my/org-roam-remove-category (node)(let ((category (list "daily" "Groups")))(not (member (cdr (assoc-string "CATEGORY" (org-roam-node-properties node))) category))))(defun my/org-roam-find-node-custom()(interactive)(org-roam-node-find nil nil 'my/org-roam-remove-category))(map! :leader:desc "Roam Nodes" :n "<return>" #'my/org-roam-find-node-custom)
The above code is how i solved the problem
fuzzbomb23 · 2022-12-17 01:44
There's a predicate function for daily notes: `org-roam-dailies--daily-note-p`. Would that help?
Under the hood, this checks if the note file is a descendent of `org-roam-dailies-directory`.
Note the double-hypen in the predicate function name. I think it's considered private-use inside the org-roam-dailies package, rather than a public API.
aadi58002 · 2022-12-17 09:08
yes i found out that there is the filter function argument for the org-roam-node-find function and i could create the function which would filter on the basics of a name. I Used the following code for it. I think the function you suggested will also work fine.
\`\`\`elisp
(defun my/org-roam-remove-category (node)
(let ((category (list "daily" "Groups")))
(not (member (cdr (assoc-string "CATEGORY" (org-roam-node-properties node))) category))))
(defun my/org-roam-find-node-custom()
(interactive)
(org-roam-node-find nil nil 'my/org-roam-remove-category))
(map! :leader
:desc "Roam Nodes" :n "<return>" #'my/org-roam-find-node-custom)
\`\`\`