add(org-roam): custom command to filter on a tag

This commit is contained in:
Laurens Miers 2025-01-07 22:05:46 +01:00
parent 28dae3bfeb
commit e692a9de93

View file

@ -1034,6 +1034,22 @@ Preserve indentation in SRC blocks
* Custom
** Org-roam
Inspired by https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#filter-by-a-tag .
#+BEGIN_SRC emacs-lisp
(defun myrmi/org-roam-node-find-tag-filter ()
"Select a single tag from list and filter `org-roam-node' by it."
(interactive)
(let ((tag (car (completing-read-multiple "Tag: "
(org-roam-tag-completions)))))
(org-roam-node-find nil nil
(lambda (node)
(member tag
(org-roam-node-tags node))))))
#+END_SRC
** Sudo current buffer
#+BEGIN_SRC emacs-lisp