[oni-org] Change location of my todo lists
This commit is contained in:
parent
489d47223e
commit
21d84a16f2
1 changed files with 14 additions and 90 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; 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)
|
;; 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
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -69,11 +69,15 @@
|
||||||
"The directory where ‘oni-org’ stores its icons.")
|
"The directory where ‘oni-org’ stores its icons.")
|
||||||
|
|
||||||
(defconst oni-org-todo-dir
|
(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.")
|
"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
|
(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.")
|
"The main file for TODO notes.")
|
||||||
|
|
||||||
(defconst oni-org-todo-someday-file
|
(defconst oni-org-todo-someday-file
|
||||||
|
@ -255,7 +259,7 @@ located at the start of the line."
|
||||||
(defun oni-org-open-index ()
|
(defun oni-org-open-index ()
|
||||||
"Open the index of my org-based personal wiki."
|
"Open the index of my org-based personal wiki."
|
||||||
(interactive)
|
(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)
|
(defun oni-org-color-for (object)
|
||||||
"Generate a color for OBJECT by using its hash as a parameter for an LCh color."
|
"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
|
;;; Inbox management
|
||||||
|
|
||||||
(defun oni-org-should-dump-tickler-p ()
|
(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))
|
(goto-char (point-min))
|
||||||
(search-forward "#+last-dumped: ")
|
(search-forward "#+last-dumped: ")
|
||||||
(let ((dumped-date (org-timestamp-to-time (org-timestamp-from-string (buffer-substring-no-properties (point) (line-end-position)))))
|
(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))))
|
(time-less-p dumped-date current-date))))
|
||||||
|
|
||||||
(defun oni-org-update-tickler-dumped-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))
|
(goto-char (point-min))
|
||||||
(search-forward "#+last-dumped: ")
|
(search-forward "#+last-dumped: ")
|
||||||
(delete-region (point) (line-end-position))
|
(delete-region (point) (line-end-position))
|
||||||
(insert (format-time-string "[%Y-%m-%d]"))))
|
(insert (format-time-string "[%Y-%m-%d]"))))
|
||||||
|
|
||||||
(defun oni-org-dump-tickler-1 ()
|
(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
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(org-forward-heading-same-level 1)
|
(org-forward-heading-same-level 1)
|
||||||
|
@ -1076,7 +1080,7 @@ placed above TARGET. Otherwise it will be placed below it."
|
||||||
(org-mode)
|
(org-mode)
|
||||||
(org-map-entries 'org-promote-subtree)
|
(org-map-entries 'org-promote-subtree)
|
||||||
(setq text (buffer-substring-no-properties (point-min) (point-max))))
|
(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
|
(save-excursion
|
||||||
(let ((max-point (point-max)))
|
(let ((max-point (point-max)))
|
||||||
(goto-char max-point)
|
(goto-char max-point)
|
||||||
|
@ -1103,7 +1107,7 @@ placed above TARGET. Otherwise it will be placed below it."
|
||||||
(oni-org-dump-tickler)
|
(oni-org-dump-tickler)
|
||||||
(catch 'done
|
(catch 'done
|
||||||
(while t
|
(while t
|
||||||
(find-file "~/documents/gtd/inbox.org")
|
(find-file oni-org-todo-inbox-file)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(org-forward-heading-same-level 1)
|
(org-forward-heading-same-level 1)
|
||||||
(when (not (org-at-heading-p))
|
(when (not (org-at-heading-p))
|
||||||
|
@ -1132,7 +1136,7 @@ placed above TARGET. Otherwise it will be placed below it."
|
||||||
(throw 'continue t))
|
(throw 'continue t))
|
||||||
(?a (org-archive-subtree-default)
|
(?a (org-archive-subtree-default)
|
||||||
(throw 'continue t))
|
(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))
|
(org-refile))
|
||||||
(throw 'continue t))
|
(throw 'continue t))
|
||||||
(?t (org-todo))
|
(?t (org-todo))
|
||||||
|
@ -1224,86 +1228,6 @@ same code all the time."
|
||||||
(map-insert ,collection ,key-name ,value-name))
|
(map-insert ,collection ,key-name ,value-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"
|
(oni-org--map-put org-capture-templates "t"
|
||||||
'("A simple TODO item." entry (file "") "* TODO %?
|
'("A simple TODO item." entry (file "") "* TODO %?
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|
Loading…
Reference in a new issue