From cb49eaf0afd1e2e004a6865bf4d7dd93a67187f5 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 27 Jul 2024 18:51:19 -0400 Subject: [PATCH] ajustments to org-mode todos and automatic setting of archive location --- org/config-org-tags.el | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/org/config-org-tags.el b/org/config-org-tags.el index a0c3843..110db83 100644 --- a/org/config-org-tags.el +++ b/org/config-org-tags.el @@ -1,9 +1,32 @@ +; log to drawer of entry +(setq org-log-into-drawer t) +(setq org-treat-insert-todo-heading-as-state-change t) + +; the ! tells org to log state changes for todo entries (setq org-todo-keywords - '((sequence "TODO(t)" "READY(r)" "WIP(w)" "|" "SKIPPED(k)" "COMPLETE(c)" "CANCELED(x)")) + '((sequence "TODO(t!)" "READY(r!)" "WIP(w!)" "|" "SKIPPED(k!)" "COMPLETE(c!)" "CANCELED(x!)")) ) (setq org-todo-keyword-faces '(("TODO" . "turquoise") ("READY" . "yellow") ("WIP" . "magenta") ("COMPLETE" . "green") ("CANCELED" . "orange")) ) + +; mangle the 'ARCHIVE' property of todo's so they archive off to a year/month.org file when complete +(defun my/org-set-archive-prop-for-todo () + (interactive) + (org-set-property "ARCHIVE" (concat + "~/org/Attic/org-mode/%s/" + (format-time-string "%Y" (current-time)) + "/" + (format-time-string "%m" (current-time)) + ".archive.org::datetree/" + ) +)) + +; hooks to auto manage todo 'ARCHIVE' property +(add-hook 'org-after-todo-state-change-hook 'my/org-set-archive-prop-for-todo) +; auto archive complete todo items +;(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook 'org-archive-all-done nil t))) + (setq org-tags-exclude-from-inheritance (quote ("@recipe" "@budgetbytes" "@vegan" "@vegetarian" "@instapot" "@slowcooker" "@onepot" "@oven" "@baked" "@baking" "@dehydrator" "@ricecooker"