Add mostalive library with org-roam immediate node
This commit is contained in:
@@ -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-))
|
||||
Reference in New Issue
Block a user