complete-computing-environment/systemcrafters-org-roam-hac...

2.9 KiB

5 Org Roam Hacks for Better Productivity in Emacs - System Crafters

Archive

This set of org-roam hacks largely map to things that are already in my CCE systems.

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)