Simplify mutli-org-roam-agenda loading

This commit is contained in:
Emmet 2024-06-29 11:50:45 -05:00
parent 86d3fe5fea
commit 23a8f9ad3a
2 changed files with 12 additions and 30 deletions

View file

@ -882,27 +882,18 @@ If the path from LINK does not exist, nil is returned."
)
)
(defun org-roam-append-notes-to-agenda (tag-name db)
(org-roam-switch-db db t)
; (org-roam-dailies-apply-old-todos-tags-to-all)
(setq org-agenda-files (append org-agenda-files (org-roam-list-notes-by-tag "todos")))
)
(defun org-roam-append-ids-to-org-id-files (db)
(org-roam-switch-db db t)
(setq org-id-files (append org-id-files (org-roam-list-files)))
)
;; Refreshing org roam agenda
(defun org-roam-refresh-agenda-list ()
(interactive)
(setq prev-org-roam-db-choice org-roam-db-choice)
(setq org-agenda-files '())
(setq org-id-files '())
(dolist (DB full-org-roam-db-list-pretty)
(org-roam-append-notes-to-agenda "todos" DB)
(org-roam-append-ids-to-org-id-files DB)
)
(setq org-roam-directory (file-truename "~/Org")
org-roam-db-location (file-truename "~/Org/org-roam.db")
org-directory (file-truename "~/Org/"))
(org-roam-db-sync)
(setq org-agenda-files (org-roam-list-notes-by-tag "todos"))
(setq org-id-files (org-roam-list-files))
(setq org-agenda-files (-uniq org-agenda-files))
(org-roam-switch-db prev-org-roam-db-choice 1)
)

View file

@ -1027,27 +1027,18 @@ exit
)
)
(defun org-roam-append-notes-to-agenda (tag-name db)
(org-roam-switch-db db t)
; (org-roam-dailies-apply-old-todos-tags-to-all)
(setq org-agenda-files (append org-agenda-files (org-roam-list-notes-by-tag "todos")))
)
(defun org-roam-append-ids-to-org-id-files (db)
(org-roam-switch-db db t)
(setq org-id-files (append org-id-files (org-roam-list-files)))
)
;; Refreshing org roam agenda
(defun org-roam-refresh-agenda-list ()
(interactive)
(setq prev-org-roam-db-choice org-roam-db-choice)
(setq org-agenda-files '())
(setq org-id-files '())
(dolist (DB full-org-roam-db-list-pretty)
(org-roam-append-notes-to-agenda "todos" DB)
(org-roam-append-ids-to-org-id-files DB)
)
(setq org-roam-directory (file-truename "~/Org")
org-roam-db-location (file-truename "~/Org/org-roam.db")
org-directory (file-truename "~/Org/"))
(org-roam-db-sync)
(setq org-agenda-files (org-roam-list-notes-by-tag "todos"))
(setq org-id-files (org-roam-list-files))
(setq org-agenda-files (-uniq org-agenda-files))
(org-roam-switch-db prev-org-roam-db-choice 1)
)