dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit a8f112d1b6a509ffa3896330a5122c92dfffad6a
parent e3e0121718737d62526944ed355cadb3cd678cb9
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Wed, 19 Jan 2022 16:43:14 +0100

emacs: more agenda customizations

Diffstat:
Memacs/config.org | 84+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 50 insertions(+), 34 deletions(-)

diff --git a/emacs/config.org b/emacs/config.org @@ -850,9 +850,12 @@ Templates for quick capture: #+end_src *** Todo & agenda views -Todo keywords based on the GTD system (pipe separates incomplete from complete): +Todo keywords based on the GTD system (pipe separates incomplete from complete). +Apart from the logging-on-done configured [[*Logging][below]], I also want to log a note & timestamp when I start waiting on something. +In ~org-todo-keywords~, ~@~ means note+timestamp, ~!~ means timestamp, ~@/!~ means note+timestamp on state entry and timestamp on leave. + #+begin_src emacs-lisp - (setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAITING(w)" "SOMEDAY(s)" "|" "DONE(d)" "CANCELLED(c)")) + (setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAITING(w@)" "SOMEDAY(s)" "|" "DONE(d)" "CANCELLED(c)")) org-todo-keyword-faces '(("TODO" . org-todo) ("NEXT" . org-todo) ("WAITING" . org-todo) @@ -910,43 +913,56 @@ Also, define a function to skip tasks (trees) that are not habits (i.e. don't ha subtree-end))) #+end_src +And another function, to skip tasks that are blocked: + +#+begin_src emacs-lisp + (defun my-skip-if-blocked () + "Skip trees that are blocked by previous tasks" + (let ((subtree-end (save-excursion (org-end-of-subtree t)))) + (if (org-entry-blocked-p) + subtree-end + nil))) +#+end_src + Create custom agenda view based on those keywords. Agenda views are made up of blocks, appearing in the order that you declare them. The first two strings are what shows up in the agenda dispatcher (the key to press and the description). #+begin_src emacs-lisp - (setq org-agenda-custom-commands - '(("n" "Next actions" - ((todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) - - ("w" "Week Agenda + Next Actions" - ((agenda "" ((org-agenda-overriding-header "Week agenda:"))) - (todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) - - ("o" "Month agenda" - ((agenda "" ((org-agenda-overriding-header "Month agenda:") - (org-agenda-span 'month))))) - - ("d" "Day Agenda + Next Actions + Habits" - ((agenda "" ((org-agenda-overriding-header "Day:") - (org-agenda-span 'day) - (org-habit-show-habits nil))) - (agenda "" ((org-agenda-overriding-header "Habits:") - (org-agenda-span 'day) - (org-agenda-use-time-grid nil) - (org-agenda-skip-function 'my-skip-unless-habit) - (org-habit-show-habits t) (org-habit-show-habits-only-for-today nil) - (org-habit-show-all-today t))) - (todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) - - ("p" "Projects" - ((tags "PROJECT" ((org-agenda-overriding-header "Projects:") - (org-agenda-prefix-format '((tags . " %i %-22(let ((deadline (org-entry-get nil \"DEADLINE\"))) (if deadline deadline \"\"))"))) - (org-agenda-sorting-strategy '((tags deadline-up alpha-down))))))) - - ("f" "Finished tasks that aren't in a project" - ((tags "TODO=\"DONE\"" ((org-agenda-overriding-header "Finished tasks:") - (org-agenda-skip-function 'my-skip-if-in-project))))))) + (setq org-agenda-custom-commands + '(("n" "Next actions" + ((todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) + ("W" "Waiting" + ((todo "WAITING" ((org-agenda-overriding-header "Waiting:"))))) + + ("w" "Week Agenda + Next Actions" + ((agenda "" ((org-agenda-overriding-header "Week agenda:"))) + (todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) + + ("o" "Month agenda" + ((agenda "" ((org-agenda-overriding-header "Month agenda:") + (org-agenda-span 'month))))) + + ("d" "Day Agenda + Next Actions + Habits" + ((agenda "" ((org-agenda-overriding-header "Day:") + (org-agenda-span 'day) + (org-habit-show-habits nil))) + (agenda "" ((org-agenda-overriding-header "Habits:") + (org-agenda-span 'day) + (org-agenda-use-time-grid nil) + (org-agenda-skip-function 'my-skip-unless-habit) + (org-habit-show-habits t) (org-habit-show-habits-only-for-today nil) + (org-habit-show-all-today t))) + (todo "NEXT" ((org-agenda-overriding-header "Next actions:"))))) + + ("p" "Projects" + ((tags "PROJECT" ((org-agenda-overriding-header "Projects:") + (org-agenda-prefix-format '((tags . " %i %-22(let ((deadline (org-entry-get nil \"DEADLINE\"))) (if deadline deadline \"\"))"))) + (org-agenda-sorting-strategy '((tags deadline-up alpha-down))))))) + + ("f" "Finished tasks that aren't in a project" + ((tags "TODO=\"DONE\"" ((org-agenda-overriding-header "Finished tasks:") + (org-agenda-skip-function 'my-skip-if-in-project))))))) #+end_src