1
0
Fork 0

oni-org: Update location of todo files

This commit is contained in:
Tom Willemse 2025-03-06 00:19:02 -08:00
parent d1b1d772fc
commit c47e475dbf
2 changed files with 11 additions and 36 deletions

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2024.0212.234817
;; Version: 2025.0305.235125
;; Package-Requires: (oni-org org-roam)
;; This program is free software; you can redistribute it and/or modify
@ -29,11 +29,12 @@
;;; Code:
(require 'oni-org)
(require 'org-roam)
(require 'seq)
(setq org-roam-completion-everywhere t)
(setq org-roam-directory (expand-file-name "~/documents/exocortex-novus/reference/"))
(setq org-roam-directory (expand-file-name "reference/" oni-org-todo-dir))
(add-hook 'org-roam-mode-hook 'visual-line-mode)
@ -94,7 +95,7 @@
(setq org-roam-node-display-template
(concat "${title:*} "
(propertize "${tags:10}" 'face 'org-tag)))
(propertize "${tags:40}" 'face 'org-tag)))
;; Only display unique references in the org-roam buffer.
(setq org-roam-mode-sections

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2025.0225.100309
;; Version: 2025.0305.221848
;; Package-Requires: (oni-yasnippet oni-hydra org org-edna diminish olivetti org-pretty-table)
;; This program is free software; you can redistribute it and/or modify
@ -76,7 +76,7 @@
"The inbox file for any notes.")
(defconst oni-org-todo-main-file
(expand-file-name "todo.org" oni-org-todo-dir)
(expand-file-name "tasks/todo.org" oni-org-todo-dir)
"The main file for TODO notes.")
(defconst oni-org-todo-someday-file
@ -87,6 +87,10 @@
(expand-file-name "tickler.org" oni-org-todo-dir)
"The tickler file for TODO notes of the future.")
(defconst oni-org-todo-events-file
(expand-file-name "events.org" oni-org-todo-dir)
"The events file for events that don't require any actions.")
;;; Functions
(defun oni-org-document-add-inline-images-startup ()
@ -437,37 +441,7 @@ and not a state update."
("video" . "video-fill.svg")
("album" . "album-fill.svg")))))
(defun oni-org-roam-todo-files ()
"Collect all files that have TODO items in them."
(mapcar
#'car
(org-roam-db-query
[:select :distinct file :from nodes :where (= todo $s1)] "TODO")))
(defun oni-org-para-todo-files ()
"Collect all task files from my PARA repository."
(delete nil
(mapcar (lambda (dir)
(cond
((string-prefix-p "." (file-name-nondirectory dir)) nil)
(t (let ((file-name (expand-file-name "tasks.org" dir)))
(and (file-exists-p file-name) file-name)))))
(append (directory-files
(expand-file-name "documents/exocortex-novus/projects" (getenv "HOME"))
:full)
(directory-files
(expand-file-name "documents/exocortex-novus/areas" (getenv "HOME"))
:full)))))
(defun oni-org-find-task-files ()
"Find all files with active tasks in them."
(split-string
(shell-command-to-string
(format "find -L %S \\( -name '.stversions' -o -name '*.sync-conflict-*' -o -name 'tickler.org' \\) -prune -o \\( -type f -name '*.org' \\) -exec grep -l TODO '{}' \\;"
oni-org-todo-dir))
"\n"))
(setq org-agenda-files (oni-org-find-task-files))
(setq org-agenda-files (list oni-org-todo-main-file oni-org-todo-events-file))
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-todo-ignore-scheduled 'future)
(setq org-agenda-restore-windows-after-quit t)