2.9 KiB
2.9 KiB
5 Org Roam Hacks for Better Productivity in Emacs - System Crafters
- Capturing tasks directly in to projects
- NEXT automatically copy or move completed tasks to dailies
- Finding nodes which are attached to a tag
- Make it an Arroyo Emacs module
This set of org-roam hacks largely map to things that are already in my CCE systems.
- Dynamic and fast agenda which is a bit different but I prefer my version. This includes a function cce/org-roam-files-with-tags which is quite useful as a general org-roam "API".
Capturing tasks directly in to projects
This is a stroke of genious:
(org-roam-capture- :node (org-roam-node-read nil (my/org-roam-filter-by-tag "Project"))
(defun cce/org-roam-capture-to-project ()
(interactive)
(org-roam-capture- :node (org-roam-node-read
nil
(lambda (node)
(-contains? (org-roam-node-tags node) "Project")))
:templates '(("p" "project" plain "* NEXT %?"
:if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
("Tasks"))))))
NEXT automatically copy or move completed tasks to dailies
this is interesting…………
Finding nodes which are attached to a tag
This is analogous to Navigating notes by relations but for Tags.
(defun cce/org-roam-find-by-tag (tag)
"select a node from a list filtered by TAG, creating it if necessary."
(interactive
(list (completing-read "Tag: " (-map (lambda (row) (car row))
(org-roam-db-query [:select tag :from tags
:group-by tag])))))
(org-roam-node-find
nil
nil
(lambda (node)
(-contains? (org-roam-node-tags node) tag))))
NEXT provide a template to the finder which sets the FILETAGS
Make it an Arroyo Emacs module
(bind-keys :map #'org-roam-prefix-map
("t" . cce/org-roam-find-by-tag)
("cp" . cce/org-roam-capture-to-project))
(provide 'cce/org-roam-hacks)