From ba12df447cac0586c2b9c687c278c07d50cb93ea Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Fri, 27 Jan 2023 12:01:53 +0100 Subject: [PATCH] added function to dynamically include todos from org-roam by filetag Project --- config.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config.org b/config.org index a5147f7..f71d22a 100644 --- a/config.org +++ b/config.org @@ -778,6 +778,23 @@ When moving BAR to archive, it will go to FILENAME.org_archive below the heading [[http://doc.endlessparentheses.com/Var/org-archive-location.html][Other examples]] ** org #+BEGIN_SRC emacs-lisp +(defun me/org-roam-filter-by-tag (tag-name) + (lambda (node) + (member tag-name (org-roam-node-tags node)))) + +(defun me/org-roam-list-notes-by-tag (tag-name) + (mapcar #'org-roam-node-file + (seq-filter + (me/org-roam-filter-by-tag tag-name) + (org-roam-node-list)))) + +(defun me/org-roam-refresh-agenda-list () + "Add all org roam files with #+filetags: Project" + (interactive) +;; (setq org-agenda-files (me/org-roam-list-notes-by-tag "Project"))) + (nconc org-agenda-files + (me/org-roam-list-notes-by-tag "Project"))) + (use-package org :ensure org-contrib :pin gnu @@ -808,12 +825,16 @@ When moving BAR to archive, it will go to FILENAME.org_archive below the heading org-agenda-files (list (concat MY--PATH_ORG_FILES "notes.org") (concat MY--PATH_ORG_FILES "projects.org") (concat MY--PATH_ORG_FILES "tasks.org"))) + (when *sys/linux* (nconc org-agenda-files (directory-files-recursively MY--PATH_ORG_FILES_MOBILE "\\.org$"))) (setq org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations") org-log-into-drawer "LOGBOOK") + ;; build the agenda list the first ime for the session + (me/org-roam-refresh-agenda-list) + ;; some display customizations (setq org-pretty-entities t org-startup-truncated t