View org agenda files, for pruning

This commit is contained in:
Benson Chu 2025-07-08 09:39:32 -05:00
parent a2692f2135
commit 7ce0237fd1
2 changed files with 38 additions and 4 deletions

View file

@ -38,5 +38,33 @@
:before
#'my/update-org-agenda-files)
(defun my/view-org-agenda-files ()
(interactive)
(find-file
(consult--read
org-agenda-files
:prompt "org-agenda-files: "
:sort nil ;; cands are already sorted
:require-match t
:state (consult--preview-org-agenda-files)
:category 'org-roam-node)))
(defun consult--preview-org-agenda-files ()
"Create preview function for nodes."
(let ((open (consult--temporary-files))
(preview (consult--buffer-preview))
(state (window-state-get)))
(lambda (action cand)
(when (eq action 'exit)
(progn
;; Restore saved window state
;; To move point to the original position
(window-state-put state)
(funcall open)))
(funcall preview action
(and cand
(eq action 'preview)
(funcall open cand))))))
(provide 'org-roam-update-agenda)
;;; org-roam-update-agenda.el ends here

View file

@ -261,6 +261,10 @@
(setq org-refile-targets `((nil :maxlevel . 9)
(org-agenda-files :maxlevel . 9)))
(global-set-key (kbd "C-c n a") #'my/view-org-agenda-files)
(setq org-agenda-sticky t)
(require 'org-protocol)
;; (defun wait-mark-blocking-tasks (change-plist)
@ -513,10 +517,12 @@
(defun my/org-roam-find-active-projects ()
(interactive)
;; Select a project file to open, creating it if necessary
(org-roam-node-find nil nil
(my/org-roam-filter-by-tag '("Project" "active"))
nil :templates my/project-templates))
(cl-letf (((symbol-function 'org-roam-node-read)
(symbol-function 'consult-org-roam-node-read)))
;; Select a project file to open, creating it if necessary
(org-roam-node-find nil nil
(my/org-roam-filter-by-tag '("Project" "active"))
nil :templates my/project-templates)))
(defun org-agenda-insert-breaks-between (str1 str2)
(let ((r (rx line-start