Complete org-mode task management rework

This commit is contained in:
Marcel Kapfer 2022-12-13 18:11:05 +01:00
parent 96b207e994
commit ee8fef3d1e
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
1 changed files with 89 additions and 39 deletions

View File

@ -1087,8 +1087,32 @@ Set TODO Keywords.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-todo-keywords '((sequence (setq org-todo-keywords '((sequence
"TODO(t!)" "NEXT(n!)" "STARTED(a!)" "WAIT(w@/!)" "SOMEDAY(s)" "TODO(t!)" "NEXT(n!)" "STARTED(s!)" "WAITING(w@/@)"
"|" "DONE(d!)" "CANCELLED(c@/!)"))) "|" "POSTPONED(p@/!)" "DELEGATED(f@/!)" "CANCELLED(c@/!)" "DONE(d!)")))
#+end_src
Set a predefined tags. The first group is the list of GTD contexts. These are (by nature) exclusive and since a project is also an exclusive state I added it to the group even if it is not a context.
#+begin_src emacs-lisp
(setq org-tag-persistent-alist '((:startgroup . nil)
("@agendas" . ?a)
("@anywhere" . ?y)
("@calls" . ?t)
("@computer" . ?c)
("@errands" . ?e)
("@fathers" . ?f)
("@home" . ?h)
("@photography" . ?s)
("@read" . ?r)
("@work_computer" . ?w)
("@project" . ?p)
(:endgroup . nil)
("coding" . ?C)
("graphic_design" . ?G)
("habit" . ?H)
("kitchen" . ?K)
("photo_editing" . ?P)
("sysadmin" . ?S)))
#+end_src #+end_src
Set time tag when re-something on todos Set time tag when re-something on todos
@ -1128,17 +1152,27 @@ Open org-agenda in current window.
Define org-capture templates. Define org-capture templates.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq mmk2410/created-date ":PROPERTIES:\n:CREATED: %U\n:END:")
(setq org-capture-templates (setq org-capture-templates
'(("t" "Normal task" entry (file "~/org/tasks/inbox.org") `(("q" "Quick Capture" entry (file "~/org/tasks/inbox.org")
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:") ,(concat "* TODO %^{Todo Title}\n:" mmk2410/created-date "\n")
:immediate-finish t)
("p" "New Personal Project" entry (file "~/org/tasks/personal.org")
,(concat "* %? :@project:\n" mmk2410/created-date "\n"))
("t" "New Personal Task" entry (file "~/org/tasks/personal.org")
,(concat "* %? %^g\n" mmk2410/created-date "\n"))
("P" "New Work Project" entry (file "~/org/tasks/work.org")
,(concat "* %? :@project:\n" mmk2410/created-date "\n"))
("T" "New Work Task" entry (file "~/org/tasks/work.org")
,(concat "* %? %^g\n" mmk2410/created-date "\n"))
("r" "New Tickler Entry" entry (file "~/org/tasks/tickler.org")
,(concat "* %?\n" mmk2410/created-date "\n%^{Remind me on}t\n"))
("e" "E-Mail needing a reply" entry (file "~/org/tasks/inbox.org") ("e" "E-Mail needing a reply" entry (file "~/org/tasks/inbox.org")
"* TODO Reply: %a\n:PROPERTIES:\n:CREATED: %U\n:END:" ,(concat "* TODO Reply: %a\n" mmk2410/created-date "\n")
:immediate-finish t) :immediate-finish t)
("p" "org-protocol-capture" entry (file "~/org/tasks/inbox.org") ("p" "org-protocol-capture" entry (file "~/org/tasks/inbox.org")
"* TODO [[%:link][%:description]]\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%i" ,(concat "* TODO [[%:link][%:description]]\n" mmk2410/created-date "\n\n%i")
:immediate-finish t) :immediate-finish t)))
("r" "Reading todo" entry (file "~/org/tasks/read-review.org")
"* TODO %^L %^G\n:PROPERTIES:\n:CREATED: %U\n:END:\n")))
#+end_src #+end_src
Configure refiling TODOs. Configure refiling TODOs.
@ -1158,7 +1192,7 @@ Configure refiling TODOs.
Warn me on deadlines in the next year. Warn me on deadlines in the next year.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-deadline-warning-days 365) (setq org-deadline-warning-days 7)
#+end_src #+end_src
Org Agenda mode settings: Org Agenda mode settings:
@ -1173,45 +1207,61 @@ Org Agenda mode settings:
(setq org-agenda-start-on-weekday nil) (setq org-agenda-start-on-weekday nil)
#+end_src #+end_src
Make the column for categories wider. I don't use the categories at all so I decided to remove the corresponding column.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-agenda-prefix-format (setq org-agenda-prefix-format
'((agenda . " %i %-15:c%?-12t% s") '((agenda . " %i %?-12t% s")
(todo . " %i") (todo . " %i")
(tags . " %i") (tags . " %i")
(search . " %i"))) (search . " %i")))
#+end_src #+end_src
Finally define the org-agenda display using [[https://github.com/alphapapa/org-super-agenda][org-super-agenda]] by alphapapa. By default, org-mode separates "blocks" (e.g. an agenda view and a todo view) with a horizontal line of equal signs and adding some headlines. Since I have more current tasks and projects than my screen is high I like to keep it as compact as possible.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-super-agenda (setq org-agenda-block-separator nil
:after org org-agenda-compact-blocks t)
:init (org-super-agenda-mode) #+end_src
:config
(setq org-agenda-block-separator nil For determining the current state of my tasks I found it helpful to not only define one org-agenda view and use it always (the "Agenda" view with the shortcut "o" was in a very similar form my default for years). That's why I decided to define additional more precise lists for todays and upcoming tasks as well as for on overview of started, waiting and next tasks.
org-agenda-compact-blocks t)
(setq org-agenda-custom-commands #+begin_src emacs-lisp
'(("c" "Complete Agenda with Todos" (setq org-agenda-custom-commands
((agenda "" ((org-agenda-span 'day) '(("o" "Agenda"
(org-deadline-warning-days 365) ((todo "STARTED")
(org-super-agenda-groups (agenda "")
'((:name "" :time-grid t :deadline future))))) (todo "NEXT")))
(alltodo "" ((org-agenda-overriding-header "") ("u" "Upcoming tasks"
(org-super-agenda-groups agenda "" ((org-agenda-span 'week)))
'((:name "High Priority" :priority "A") ("d" "Today tasks"
(:name "Inbox" :file-path ".*/org/inbox\\.org$") agenda "" ((org-agenda-span 'day)))
(:name "[Work] Inbox" :file-path ".*/org/work\\.inbox\\.org$") ("b" "Started tasks" todo "STARTED")
(:name "Emails" :file-path ".*/org/emails\\.org$") ("w" "Waiting for tasks" todo "WAITING")
(:name "Next" :todo "NEXT") ("n" "Next tasks" todo "NEXT")))
(:name "Started" :todo "STARTED") #+end_src
(:name "[Work] Projects" :file-path ".*/org/work\\.projects\\.org$")
(:name "Study" :and (:file-path ".*/org/study\\.org$" :not(:scheduled future))) For easily choosing the next thing to work on I give each of my tasks a context (following the GTD methodology). For quickly getting a list of all actionable tasks for a context I'd like to have a quick keyboard shortcut to view a custom agenda. For this I defined a list of contexts and their shortcut and iterated over them to create an additional ~org-agenda-custom-commands~ entry for each.
(:name "Reading" :file-path ".*/org/reading\\.org$")
(:name "Projects" :file-path ".*/org/projects\\.org$") #+begin_src emacs-lisp
(:name "Habits" :habit t :order 100) (setq mmk2410/contexts
(:name "Someday" :todo "SOMEDAY" :scheduled future :order 101)))))))))) '(("@agendas" . "a")
("@anywhere" . "y")
("@calls" . "t")
("@computer" . "c")
("@errands" . "e")
("@fathers" . "f")
("@home" . "h")
("@photography" . "s")
("@read" . "r")
("@work_computer" . "w")))
(dolist (item mmk2410/contexts)
(add-to-list 'org-agenda-custom-commands
`(,(concat "c" (cdr item))
,(concat (substring (car item) 1) " context")
tags-todo
,(concat (car item) "/!NEXT"))))
#+end_src #+end_src
** Quick Capture from everywhere ** Quick Capture from everywhere