My task management with org-mode
Written by Sebastian Dümcke on
Tags: emacs productivity
Whenever I feel I am loosing control over my life or feeling stalled in too many projects I turn to improving my PM setup. This summer, being in a period of transition, I have obsessed with it again. A few years back when this last happened, I move to org-mode. I do not regret this, emacs with org-mode is an incredible tool, which fits well with my way or working (keyboard driven and text based).
These phases are important for me to regain the illusion of control, because in the end we do not have control over most events:
life is what happens while you have other plans — Anonymous
So this summer I set up an elaborate PM system in org-mode along with time tracking, tracking of every break I am taking and so on. I will only briefly describe it here. Instead I will tell you which parts actually stuck and improved my life. Some of the things I describe are part of “Getting Things Done” (GTD), a task management system by David Allen.
Central inbox
This part was really helpful to me: quickly dump any idea that comes to mind. Collect everything, knowing it will be processed at some point and never fall through the cracks. This is a way for me to empty everything in my head and get rid of nagging thought such as: “do not forget to do X next week”
It is also trivial to implement in org-mode using org-capture. So no IU have a capture template, that I can call from anywhere within emacs with a simple keyboard short cut. I can then type the TODO task out and close the capture window. I can even do this blinded.
When I am away from the computer, I use my mobile phone. Simply use any note app you already have or can install. Then during the weekly review, send it to yourself via email or other means and add tasks to your inbox.
Every idea, thought, task gets dropped into the inbox, no matter how small. Since I know , that once in the system the task is safe, I can safely forget about it until the next review and once refiled and perhaps scheduled, until relevant. That provides me with peace of mind and I do not obsessively worry about remembering tasks any more. I also have a paper inbox, where I put letters, bills and other papers, which gets cleared during the weekly review.
Weekly reviews
This part is indispensable together with the inbox: this is where the system is kept up-to-date and each task from the inbox is either completed or refiled for later or delegated. It is also where I choose what to work on next. This should be as short as possible because you should do it weekly. However, I found, that in the past 6 months it always took me between 28 minutes and 90 minutes to complete (mean of 43 minutes). I use a template with check boxes for the review as follows:
What to review: - [X] Check papers inbox for potential tasks and add to refile.org - [X] add tasks from mobile phone to refile.org - [X] close all browser tabs. If relevant to a project create a note and file - [X] close all unused sway workspaces. - [X] review weekly agenda and thunderbird calendar of past week and record any tasks that come to mind - [X] review thunderbird calendar and org agenda for next week - [X] refile items not yet refiled Complete tasks if that take less than 2 mins. - [ ] Review clock report for past week Check where we spent time (too much or too little) and rectify this week #+BEGIN: clocktable :scope agenda :maxlevel 5 :block lastweek :step week :fileskip0 t :tcolumns 1 - [X] Review list of all TODOs, use further sorting using '/' key. Choose which to promote to NEXT to do soon
The first part of the review is to record any further tasks into the inbox (using the capture template discussed in the previous section). The second part is about handling all tasks in the inbox and the last part is about planning the time until the next review (and I added some review of the clock report I will discuss further below).
One thing I have added to the review: I regularly close my browser tabs and windows during the review. This has been a life change for me, I will write about this in more detail in a future post but highly recommend to do this digital de-cluttering.
Currently this works well for me, though I am a bit overwhelmed when choosing what to work on next in the last part of the review. Also the process I have to refile things in org-mode is rather slow on completing all possible headers. This is something I want to improve in the future.
Agenda setup
Finally, this time around, I feel I understood the purpose of the org agenda. Before, I was simply using this to check if any scheduled tasks or deadlines were coming up. Now I am using this to guide the process. In a perfect world, you would spend most time in the agenda. I designed it to be processed from top to bottom:
- Todays calendar: check what appointment you have today on daily agenda. Check deadlines and start working on important tasks scheduled for the day
- Tasks I am currently working on: continue working on IN_PROGRESS tasks. Goal should be to have as few IN_PROGRESS as possible (reduce number of open loops)
- Next tasks to work on: tasks with status NEXT. Choose any of these after completing the IN_PROGRESS tasks
- Delegated tasks: review status of delegated tasks: send reminder or call people if these become blockers
- Tasks currently on hold: all tasks with status HOLD:
So in a typical day, I fire up the agenda in the morning, then check my apointments for today and any tasks I had scheduled for today as well as any deadlines. My habits also show up here are the bottom. I will then first open a capture template for Email to track the time I spend checking Emails. Then I will clock into one of the IN_PROGRESS tasks (by pressing I
on the tasks) and work on it. One completed I will choose a NEXT task and clock into this (which will automatically switch it to IN_PROGRESS). Lather, rinse, repeat.
Time tracking
Org allows to clock in and out of tasks and record time spend on tasks. The agenda also has a “clock consistency” report that will highlight any gaps in clocking time. It also has a “clock report” view to show where one has spent time each day.
Let’s be honest: this effort is really only relevant if you are selling your time. Or really enjoy this.
No matter how hard I try, I cannot consistently track all time spent during the day (because I forget to either clock in or out). It also does not matter that much. I take care to properly clock in and out when I do client work, and it makes generating invoices really easy. I also run some automatic clocks in the background during capture processes: these help track time without further effort on my part. In the end, I make use of the data I have to draw some conclusion. Did you notice, how I was able to determine min/max/mean time spend on my weekly reviews in the previous section? This is because I start my review with a capture template that automatically clocks into the task. Then once I complete the review and go to work on something else, it clocks out.
Tracking breaks and interuptions
One thing that might be of help to people that feel like they get very little done despite spending hours at their desk: you might be constantly interrupted! You could set up a capture template for interruptions to assess how often you get interrupted during the day and how long these lasts. I currently capture into a “Breaks” heading when I go for lunch and track meeting/calls as well.
The setup in code
Let’s go through the required set up in your init.el. I will break up the code below into chunks so that I can comment on the content. However, they need to be all pasted together.
(use-package org :config (setq org-directory "~/orgfiles" ;set org directory. Paths in org-agenda files and capture templates are relative to this org-agenda-files (quote ("org.org" "refile.org" "personal.org";add all relevant projects relative to org-directory path. Order matters: using category-keep sorting in org-agenda views will show tasks coming from the files in the order they are defined here! org-default-notes-file (concat org-directory "/refile.org") ;default target for all capture templates that do not indicate a file target org-log-done 'time ;log time a task was marked as done org-clock-into-drawer t ;put clock in/out info into the LOGBOOK drawer org-log-into-drawer t ;log state changes and associated notes into LOGBOOK drawer org-clock-out-remove-zero-time-clocks t ;remove clock entries below 1 minute org-deadline-warning-days 6 ;start showing deadlines in Agenda 6 days prior org-catch-invisible-edits 'error ;avoid invisible edits org-agenda-clockreport-parameter-plist '(:link t :maxlevel 5 :fileskip0 t :level nil :hidefiles nil :tcolumns 1) ;how should the agenda clock report table look like? org-duration-format 'h:mm org-todo-keywords '((sequence "TODO" "NEXT(!)" "IN_PROGRESS" "HOLD(@)" "|" "DONE(d)" "CANCELLED(c@)")) org-todo-keyword-faces '(("IN_PROGRESS" . "orange") ("FAILED" . "red") ("CANCELLED" . "red") ("DONE" . "green")) ;ignored/overwritten by org-modern org-clock-in-switch-to-state 'samd/clock-in-switch-state ; switch task to IN_PROGRESS unless we are in a capture buffer or task has no TODO keyword
This is the general setup of org. I define the main directory where I keep my org files, name the files that to be part of any agenda view and setup clocking and todo keywords. I use the following sequence of TODO keywords:
- TODO: every task starts here
- NEXT: this should be done next
- IN_PROGRESS: currently working on this task. A tasks move automatically into this state once I clock in , unless I am in a capture buffer (this is what
samd/clock-in-switch-state
does. - DONE: task was completed, time of completion is logged automatically
- CANCELLED: task was not completed, usually it became obsolete. Here I am asked to log a short note about why I cancelled the task.
My inbox is called refile.org
and is set as org-default-notes-file
so as to make it the default for all capture templates that do not define a file target.
org-refile-targets '((org-agenda-files . (:maxlevel . 9))) ;add headings in any file contributing to the agenda as potential refile targets up to 9 levels deep. Depth OK since we use incremental completion to find the right heading org-refile-use-outline-path 'file org-outline-path-complete-in-steps nil org-refile-allow-creating-parent-nodes 'confirm org-refile-use-cache t ;cache path/outlines for refile; TODO: invalidate the cache regularly see here: https://yiming.dev/blog/2018/03/02/my-org-refile-workflow/
This part is for the refile set up. I use a deep level on all tasks part of the agenda files. This is meant to work together with a completion framework. I also prepend the outline path including the file name to the refile selection. Still not quite happy with this.
org-agenda-custom-commands '((" " "My Agenda" ((agenda "" ((org-agenda-span 'day) (org-agenda-prefix-format " %i %?-12t% s %?-5e"))) (todo "IN_PROGRESS" ((org-agenda-overriding-header "Tasks I am currently working on:") (org-agenda-prefix-format " %?i %?-12 c"))) (todo "NEXT" ((org-agenda-overriding-header "Next tasks to work on:") (org-agenda-sorting-strategy '(category-up)) (org-agenda-prefix-format " %?i %?-12 c"))) (tags "ALLOCATE<>\"\"/-DONE-CANCELLED" ((org-agenda-overriding-header "Delegated tasks:") (org-agenda-prefix-format " %i %(cdr (assoc \"ALLOCATE\" (org-entry-properties (point) \"ALLOCATE\"))) "))) (todo "HOLD" ((org-agenda-overriding-header "Tasks currently on hold:") (org-agenda-prefix-format " %i %b"))))) ("w" "Weekly review" ((agenda "" ((org-agenda-span 'week) (org-agenda-overriding-header "Review past week") (org-agenda-start-day "-1w"))) (agenda "" ((org-agenda-span 'week) (org-agenda-overriding-header "Review next week"))) (tags "refile+LEVEL=1" ((org-agenda-overriding-header "Tasks to Refile:") (org-agenda-prefix-format " %?-5e"))) (todo "NEXT" ((org-agenda-prefix-format " %-12c [%4e]") (org-agenda-overriding-header "Demote some NEXT Tasks?:"))) (todo "TODO" ((org-agenda-overriding-header "Choose what to work on next:") (org-agenda-prefix-format " %-12c [%4e]")))))) org-capture-templates '(("t" "TODO entry" entry (file "") "* TODO %?\12%U\12%i" :clock-resume t) ("m" "Meeting/Call" entry (file "") "* %T Meeting/Call with %? :meeting:\12%i" :clock-resume t :clock-in t) ("b" "Break" entry (file+headline "org.org" "Breaks") "* Break %?" :clock-resume t :clock-in t) ("e" "Email" entry (file+headline "org.org" "Emails") "* Email %?" :clock-resume t :clock-in t) ("f" "Templates/Forms") ("fw" "weekly review") ("fwm" "weekly review Monday" entry (file+headline "org.org" "Weekly Reviews") "* %u Weekly Review\12What to review: %?\12- [ ] Check papers inbox for potential tasks and add to refile.org\12- [ ] add tasks from mobile phone to refile.org \12- [ ] close all browser tabs. If relevant to a project create a note and file\12- [ ] close all unused sway workspaces.\12- [ ] review weekly agenda and thunderbird calendar of past week and record any tasks that come to mind\12- [ ] review thunderbird calendar and org agenda for next week\12- [ ] refile items not yet refiled\12 Complete tasks if that take less than 2 mins.\12- [ ] Review clock report for past week\12 Check where we spent time (too much or too little) and rectify this week\12 #+BEGIN: clocktable :scope agenda :maxlevel 5 :block lastweek :step week :fileskip0 t :tcolumns 1\12#+END:\12- [ ] Review list of all TODOs, use further sorting using '/' key. Choose which to promote to NEXT to do soon" :clock-in t :clock-keep t :jump-to-captured t :immediate-finish t) ("fwf" "weekly review Friday/Weekend" entry (file+headline "org.org" "Weekly Reviews") "* %u Weekly Review\12What to review: %?\12- [ ] Check papers inbox for potential tasks and add to refile.org\12- [ ] add tasks from mobile phone to refile.org \12- [ ] close all browser tabs. If relevant to a project create a note and file\12- [ ] close all unused sway workspaces.\12- [ ] review weekly agenda and thunderbird calendar of past week and record any tasks that come to mind\12- [ ] review thunderbird calendar and org agenda for next week\12- [ ] refile items not yet refiled\12 Complete tasks if that take less than 2 mins.\12- [ ] Review clock report for past week\12 Check where we spent time (too much or too little) and rectify this week\12 #+BEGIN: clocktable :scope agenda :maxlevel 5 :block thisweek :step week :fileskip0 t :tcolumns 1\12#+END:\12- [ ] Review list of all TODOs, use further sorting using '/' key. Choose which to promote to NEXT to do soon" :clock-in t :clock-keep t :jump-to-captured t :immediate-finish t))) :hook ((org-capture-mode . evil-insert-state) ;enter evil state when opening capture window (org-log-buffer-setup . evil-insert-state))) ;enter evil state when prompted for note on TODO state change
Finally, these are the agenda view for day to day, the agenda view to go through the checklist of the weekly review and the capture templates that I use:
- a simple TODO capture template to record any task to the inbox
- a capture template for email: I just starts a clock. I use this to record how much time I spend reading emails during the day
- a capture template for meetings or a call I receive. Meant to track interruption but I know use these to record notes during my calls
- a capture template for beaks: Mainly used for lunch or when I go out for errands during work time
- templates for the weekly review (with small changes depending on whether I do the review on a Monday (for the past week) or a Friday (reviewing the current week)
Here is the function to switch a task to IN_PROGRESS:
(defun samd/clock-in-switch-state (kw) "Switch to IN_PROGRESS unless we are in capture mode or there is no TODO kw assigned" (when (and kw (not (and (boundp 'org-capture-mode) org-capture-mode))) "IN_PROGRESS"))
Things that did not stick
Contexts
“Getting things done” has the concept of contexts. Some tasks can only be done in a certain context (e.g. “Buy Milk” can only be completed when you are at the shop). So David Allen suggests having context sensitive tasks lists. I did not even implement location tags, as most tasks I track can be done in front of the computer.
Effort estimates
Another thing that org allows to do: estimate effort for tasks and then compare the time clocked into a task to the effort. Also sorting tasks by effort. The goal here could be to solved the following: I have 12 minutes before my next appointment, what task can I work on in this time. And then draw up a list of tasks which an effort below 12 minutes. For me this is not worth the time for most tasks, I am only doing it for tasks that are part of a project where I was asked to provide a quote up-front. Then I generate the quote in orgmode from the effort estimates. And later track my time against these. That way I know if I am over/under budget.
Stuck projects
Finally, GTD also has the concept of “stuck projects”. A project is stuck when none of its subtasks can be done NEXT. It is part of the weekly review in GTD to ensure no projects are stuck and all projects move along. I tried to use this, however a lot of my projects are not important (e.g. hobbies) and thus can be stuck without cost.