Use theurgy-org-directory in all places

This commit is contained in:
BirDt_ 2026-01-13 21:20:07 +08:00
parent de68cdc05e
commit bacf9ceb0a

View file

@ -373,13 +373,13 @@
(defun new-maintenance-file (maintenance-area) (defun new-maintenance-file (maintenance-area)
"Create a new maintenance file for a given `MAINTENANCE-AREA'." "Create a new maintenance file for a given `MAINTENANCE-AREA'."
(interactive "sMaintenance area is: ") (interactive "sMaintenance area is: ")
(find-file (concat "~/.org/tasks/maintenance/" maintenance-area ".org")) (find-file (concat theurgy-org-directory "tasks/maintenance/" maintenance-area ".org"))
(insert "\n\n* Calendar\n\n* TO-DO\n\n* Routines\n\n* Archive\n") (insert "\n\n* Calendar\n\n* TO-DO\n\n* Routines\n\n* Archive\n")
(goto-char (point-min))) (goto-char (point-min)))
(defun new-project-file (project-name acceptance-criteria) (defun new-project-file (project-name acceptance-criteria)
"Create a new project file for a given `PROJECT-NAME', with some `ACCEPTANCE-CRITERIA'." "Create a new project file for a given `PROJECT-NAME', with some `ACCEPTANCE-CRITERIA'."
(find-file (concat "~/.org/tasks/projects/" project-name ".org")) (find-file (concat theurgy-org-directory "tasks/projects/" project-name ".org"))
(insert (concat "\n\n* Acceptance Criteria\n\n" acceptance-criteria "\n\n* Ideas\n\n* TODO Work\n\n** Calendar\n\n** TO-DO\n\n** Routines\n\n** Archive\n")) (insert (concat "\n\n* Acceptance Criteria\n\n" acceptance-criteria "\n\n* Ideas\n\n* TODO Work\n\n** Calendar\n\n** TO-DO\n\n** Routines\n\n** Archive\n"))
(goto-char (point-min))) (goto-char (point-min)))
@ -396,12 +396,12 @@
;; Captures ;; Captures
(defun select-task-area (location headline) (defun select-task-area (location headline)
"Prompt for a file in ~/.org/tasks/maintenance/ to insert the capture." "Prompt for a file in ~/.org/tasks/maintenance/ to insert the capture."
(let* ((files (directory-files (concat "~/.org/tasks/" location) t "\\.org$")) (let* ((files (directory-files (concat theurgy-org-directory "tasks/" location) t "\\.org$"))
(choices (mapcar (choices (mapcar
(lambda (x) (string-remove-suffix ".org" x)) (lambda (x) (string-remove-suffix ".org" x))
(mapcar #'file-name-nondirectory files))) (mapcar #'file-name-nondirectory files)))
(selected (completing-read "Choose a file: " choices nil t))) (selected (completing-read "Choose a file: " choices nil t)))
(set-buffer (org-capture-target-buffer (concat "~/.org/tasks/" location selected ".org"))) (set-buffer (org-capture-target-buffer (concat theurgy-org-directory "tasks/" location selected ".org")))
(org-capture-put-target-region-and-position) (org-capture-put-target-region-and-position)
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
@ -423,7 +423,7 @@
(setq org-capture-templates (setq org-capture-templates
'(("i" "Idea") '(("i" "Idea")
("ii" "Generic" entry ("ii" "Generic" entry
(file "~/.org/inbox.org") (file (concat theurgy-org-directory "inbox.org"))
"* %^{TITLE} :idea: \n\n%?" "* %^{TITLE} :idea: \n\n%?"
:empty-lines 1) :empty-lines 1)
("ip" "Project" entry ("ip" "Project" entry
@ -438,7 +438,7 @@
("t" "Task") ("t" "Task")
("tt" "Generic") ("tt" "Generic")
("ttt" "Raw" entry ("ttt" "Raw" entry
(file "~/.org/inbox.org") (file (concat theurgy-org-directory "inbox.org"))
"* TODO [%^{priority|#A|#B|#C|#D}] %^{TITLE} :task:\n\n%?" "* TODO [%^{priority|#A|#B|#C|#D}] %^{TITLE} :task:\n\n%?"
:empty-lines 1) :empty-lines 1)
("ttm" "Maintenance" entry ("ttm" "Maintenance" entry
@ -455,7 +455,7 @@
:empty-lines 1) :empty-lines 1)
("ts" "Scheduled") ("ts" "Scheduled")
("tss" "Raw" entry ("tss" "Raw" entry
(file "~/.org/inbox.org") (file (concat theurgy-org-directory "inbox.org"))
"* TODO [%^{priority|#A|#B|#C|#D}] %^{TITLE} :scheduled:\n:SCHEDULED: %^T\n%?" "* TODO [%^{priority|#A|#B|#C|#D}] %^{TITLE} :scheduled:\n:SCHEDULED: %^T\n%?"
:empty-lines 1 :empty-lines 1
:time-prompt t) :time-prompt t)
@ -477,12 +477,12 @@
("n" "Note") ("n" "Note")
("nn" "Raw" entry ("nn" "Raw" entry
(file "~/.org/inbox.org") (file (concat theurgy-org-directory "inbox.org"))
"* %^{TITLE} :note: \n\n%?" "* %^{TITLE} :note: \n\n%?"
:empty-lines 1) :empty-lines 1)
("nm" "Meeting") ("nm" "Meeting")
("nmm" "Raw" entry ("nmm" "Raw" entry
(file "~/.org/inbox.org") (file (concat theurgy-org-directory "inbox.org"))
"* %^{TITLE} :meeting: \n\n%?" "* %^{TITLE} :meeting: \n\n%?"
:clock-in t :clock-in t
:clock-resume t) :clock-resume t)
@ -496,22 +496,22 @@
(defun open-inbox () (defun open-inbox ()
"Opens `~/.org/inbox.org'" "Opens `~/.org/inbox.org'"
(interactive) (interactive)
(find-file "~/.org/inbox.org")) (find-file (concat theurgy-org-directory "inbox.org")))
(defun open-maintenance () (defun open-maintenance ()
"Opens `~/.org/tasks/maintenance/'" "Opens `~/.org/tasks/maintenance/'"
(interactive) (interactive)
(find-file "~/.org/tasks/maintenance/")) (find-file (concat theurgy-org-directory "tasks/maintenance/")))
(defun open-projects () (defun open-projects ()
"Opens `~/.org/tasks/projects/'" "Opens `~/.org/tasks/projects/'"
(interactive) (interactive)
(find-file "~/.org/tasks/projects/")) (find-file (concat theurgy-org-directory "tasks/projects/")))
(defun open-career () (defun open-career ()
"Opens `~/.org/tasks/projects/career/'" "Opens `~/.org/tasks/projects/career/'"
(interactive) (interactive)
(find-file "~/.org/tasks/projects/career/")) (find-file (concat theurgy-org-directory "tasks/projects/career/")))
(transient-define-prefix task-management-menu () (transient-define-prefix task-management-menu ()
"Transient menu for task management shortcuts." "Transient menu for task management shortcuts."
@ -543,15 +543,15 @@
(window-width . 0.2)))) (window-width . 0.2))))
;; Org roam ;; Org roam
(when (file-directory-p "~/.org/lore") (when (file-directory-p (concat theurgy-org-directory "lore"))
(use-package org-roam (use-package org-roam
:straight nil :straight nil
:ensure t :ensure t
:init :init
(setq org-roam-v2-ack t) (setq org-roam-v2-ack t)
:custom :custom
(org-roam-directory (file-truename "~/.org/lore/")) (org-roam-directory (file-truename (concat theurgy-org-directory "lore/")))
(org-roam-dailies-directory (file-truename "~/.org/lore/refined/journal/")) (org-roam-dailies-directory (file-truename (concat theurgy-org-directory "lore/refined/journal/")))
(org-roam-file-exclude-regexp "\\.git/.*\\|logseq/.*$") (org-roam-file-exclude-regexp "\\.git/.*\\|logseq/.*$")
(org-roam-completion-everywhere) (org-roam-completion-everywhere)
(org-roam-capture-templates (org-roam-capture-templates