From 21d84a16f2c26f7468c17359126fdb033a3f8b4e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 1 Feb 2024 16:39:45 -0800 Subject: [PATCH] [oni-org] Change location of my todo lists --- oni-org/oni-org.el | 104 ++++++--------------------------------------- 1 file changed, 14 insertions(+), 90 deletions(-) diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 0093ea2..5d2ebf4 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.1114.143023 +;; Version: 2024.0201.163746 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-bullets org-edna diminish all-the-icons olivetti form-feed org-pretty-table ob-async) ;; This program is free software; you can redistribute it and/or modify @@ -69,11 +69,15 @@ "The directory where ‘oni-org’ stores its icons.") (defconst oni-org-todo-dir - (expand-file-name "documents/gtd" (getenv "HOME")) + (expand-file-name "documents/exocortex-novus/tasks" (getenv "HOME")) "The directory where all the TODO notes are stored.") +(defconst oni-org-todo-inbox-file + (expand-file-name "inbox.org" oni-org-todo-dir) + "The inbox file for any notes.") + (defconst oni-org-todo-main-file - (expand-file-name "everything.org" oni-org-todo-dir) + (expand-file-name "todo.org" oni-org-todo-dir) "The main file for TODO notes.") (defconst oni-org-todo-someday-file @@ -255,7 +259,7 @@ located at the start of the line." (defun oni-org-open-index () "Open the index of my org-based personal wiki." (interactive) - (find-file (oni-org-expand-to-home "documents/gtd/index.org"))) + (find-file (oni-org-expand-to-home "documents/exocortex-novus/index.org"))) (defun oni-org-color-for (object) "Generate a color for OBJECT by using its hash as a parameter for an LCh color." @@ -1045,7 +1049,7 @@ placed above TARGET. Otherwise it will be placed below it." ;;; Inbox management (defun oni-org-should-dump-tickler-p () - (with-current-buffer (find-file-noselect "~/documents/gtd/tickler.org") + (with-current-buffer (find-file-noselect oni-org-todo-tickler-file) (goto-char (point-min)) (search-forward "#+last-dumped: ") (let ((dumped-date (org-timestamp-to-time (org-timestamp-from-string (buffer-substring-no-properties (point) (line-end-position))))) @@ -1053,14 +1057,14 @@ placed above TARGET. Otherwise it will be placed below it." (time-less-p dumped-date current-date)))) (defun oni-org-update-tickler-dumped-date () - (with-current-buffer (find-file-noselect "~/documents/gtd/tickler.org") + (with-current-buffer (find-file-noselect oni-org-todo-tickler-file) (goto-char (point-min)) (search-forward "#+last-dumped: ") (delete-region (point) (line-end-position)) (insert (format-time-string "[%Y-%m-%d]")))) (defun oni-org-dump-tickler-1 () - (with-current-buffer (find-file-noselect "~/documents/gtd/tickler.org") + (with-current-buffer (find-file-noselect oni-org-todo-tickler-file) (save-excursion (goto-char (point-min)) (org-forward-heading-same-level 1) @@ -1076,7 +1080,7 @@ placed above TARGET. Otherwise it will be placed below it." (org-mode) (org-map-entries 'org-promote-subtree) (setq text (buffer-substring-no-properties (point-min) (point-max)))) - (with-current-buffer (find-file-noselect "~/documents/gtd/inbox.org") + (with-current-buffer (find-file-noselect oni-org-todo-inbox-file) (save-excursion (let ((max-point (point-max))) (goto-char max-point) @@ -1103,7 +1107,7 @@ placed above TARGET. Otherwise it will be placed below it." (oni-org-dump-tickler) (catch 'done (while t - (find-file "~/documents/gtd/inbox.org") + (find-file oni-org-todo-inbox-file) (goto-char (point-min)) (org-forward-heading-same-level 1) (when (not (org-at-heading-p)) @@ -1132,7 +1136,7 @@ placed above TARGET. Otherwise it will be placed below it." (throw 'continue t)) (?a (org-archive-subtree-default) (throw 'continue t)) - (?d (let ((org-refile-targets '(("~/documents/gtd/tickler.org" :maxlevel . 10)))) + (?d (let ((org-refile-targets `((,oni-org-todo-tickler-file :maxlevel . 10)))) (org-refile)) (throw 'continue t)) (?t (org-todo)) @@ -1224,86 +1228,6 @@ same code all the time." (map-insert ,collection ,key-name ,value-name)) ,value-name))))) -(oni-org--map-put org-agenda-custom-commands "o" - '("Overview" ((tags-todo "TODO=\"WAITING\"" - ((org-agenda-overriding-header (oni-org--center-align "Waiting")))) - (tags-todo "TODO=\"WIP\"" - ((org-agenda-overriding-header (oni-org--center-align "In Progress")))) - (agenda "" ((org-agenda-span 'day))) - (tags-todo "TODO=\"TODO\"+#todo" - ((org-agenda-max-todos 10) - (org-agenda-overriding-header (oni-org--center-align "To Do")))) - (tags-todo "TODO=\"TODO\"+#reading" - ((org-agenda-max-todos 5) - (org-agenda-overriding-header (oni-org--center-align "Read")))) - (tags-todo "TODO=\"TODO\"+#watching" - ((org-agenda-max-todos 5) - (org-agenda-overriding-header (oni-org--center-align "Watch")))) - (tags-todo "TODO=\"TODO\"+#listening" - ((org-agenda-max-todos 5) - (org-agenda-overriding-header (oni-org--center-align "Listen"))))))) - -(oni-org--map-put org-agenda-custom-commands "t" - '("To Do" ((tags-todo "TODO=\"WAITING\"+#todo" - ((org-agenda-overriding-header (oni-org--center-align "Waiting To Do")))) - (tags-todo "TODO=\"WIP\"+#todo" - ((org-agenda-overriding-header (oni-org--center-align "Doing")))) - (tags-todo "TODO=\"TODO\"+#todo" - ((org-agenda-overriding-header (oni-org--center-align "To Do"))))))) - -(oni-org--map-put org-agenda-custom-commands "r" - '("Reading" ((tags-todo "TODO=\"WAITING\"+#reading" - ((org-agenda-overriding-header (oni-org--center-align "Waiting To Read")))) - (tags-todo "TODO=\"WIP\"+#reading" - ((org-agenda-overriding-header (oni-org--center-align "Reading")))) - (tags-todo "TODO=\"TODO\"+#reading" - ((org-agenda-overriding-header (oni-org--center-align "To Read"))))))) - -(oni-org--map-put org-agenda-custom-commands "w" - '("Watching" ((tags-todo "TODO=\"WAITING\"+#watching" - ((org-agenda-overriding-header (oni-org--center-align "Waiting To Watch")))) - (tags-todo "TODO=\"WIP\"+#watching" - ((org-agenda-overriding-header (oni-org--center-align "Watching")))) - (tags-todo "TODO=\"TODO\"+#watching" - ((org-agenda-overriding-header (oni-org--center-align "To Watch"))))))) - -(oni-org--map-put org-agenda-custom-commands "l" - '("Listening" ((tags-todo "TODO=\"WAITING\"+#listening" - ((org-agenda-overriding-header (oni-org--center-align "Waiting To Listen To")))) - (tags-todo "TODO=\"WIP\"+#listening" - ((org-agenda-overriding-header (oni-org--center-align "Listening")))) - (tags-todo "TODO=\"TODO\"+#listening" - ((org-agenda-overriding-header (oni-org--center-align "To Listen To"))))))) - -(oni-org--map-put org-capture-templates "sE" - '("Questions for Emacs packages" plain (function ignore) - "- Do I want to integrate this in my configuration? - - %? -- What will it add / What advantage will it bring? - - -- How would I integrate it with my config? - - " - :empty-lines 1 - :immediate-finish t - :jump-to-captured t)) -(oni-org--map-put org-capture-templates-contexts "sE" - '(((in-mode . "org-mode")))) - -(oni-org--map-put org-capture-templates "se" - '("Questions for Emacs articles" plain (function ignore) - "- What can I add to my config from this? - - %?" - :empty-lines 1 - :immediate-finish t - :jump-to-captured t)) -(oni-org--map-put org-capture-templates-contexts "se" - '(((in-mode . "org-mode")))) - -(oni-org--map-put org-capture-templates "s" - '("Snippets")) -(oni-org--map-put org-capture-templates-contexts "s" - '(((in-mode . "org-mode")))) - (oni-org--map-put org-capture-templates "t" '("A simple TODO item." entry (file "") "* TODO %? :PROPERTIES: