mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-18 22:55:52 +05:30
Simplify mutli-org-roam-agenda loading
This commit is contained in:
parent
86d3fe5fea
commit
23a8f9ad3a
|
@ -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)
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue