Add mostalive library with org-roam immediate node

This commit is contained in:
Willem van den Ende
2023-01-31 15:06:15 +00:00
parent 527b64159c
commit fc2c68cac5
2 changed files with 44 additions and 13 deletions
+32
View File
@@ -0,0 +1,32 @@
;;; mostalive/my-org-roam.el -*- lexical-binding: t; -*-
(provide 'my-org-roam)
;; Insert a link to a node, don't go to buffer when the node is new.
(defun org-roam-node-insert-immediate (arg &rest args)
(interactive "P")
(let ((args (push arg args))
(org-roam-capture-templates
(list
(append (car org-roam-capture-templates) '(:immediate-finish t)))))
(apply #'org-roam-node-insert args)))
;; make sure that org-timer works and org-pomodoro therefore. Limit the number of agenda files searched
;; plus a utility function for flattening, since that is not part of the standard library of emacs
(defun org-roam-collect-org-agenda-files ()
(interactive)
(collect-org-agenda-files-))
(defun collect-org-agenda-files- ()
(seq-map
'car
(org-roam-db-query
[:select
[file]
:from files
:where (like file "%daily\/2023%")
:order-by (desc file)
:limit 20])))
(setq org-agenda-files (collect-org-agenda-files-))