To-do Lists with Org
Among Emacs enthusiasts I think I have been a latecomer to org-mode. Truth is I have dabbled with it on and off for years, but time and again found myself returning to pen and paper or my own never-fully-developed structured text format for my note-taking needs. This summer I came back to org to try one more time to grok it and make it my one true text format, and I think this time it's for keeps.
Learning to use the agenda and global to-do views were the first two things that improved my org experience. Those are rather obvious though, so I didn't intend to blog about them. Customizing the way to-do items work was the latest, and getting that just right involved a bit of research, not only reading the docs, but also the source code, and getting some help from those who have gone this way before.
The way I think about a to-do item is like this. I want to keep a full log of my progress with any given item. That means I want to notate not only when I completed the item (which org does by default) but I also want a record of when I created the item, and also records of each point of progress. Here is what I came up with:
'((sequence "TODO(t!)" "|" "DONE(d!)" "CANCELLED(c!)")))
(setq org-treat-insert-todo-heading-as-state-change t
'(setcdr (assq 'state org-log-note-headings)
"State -> %s %t"))
Let's just run down these variables one by one.
I have configured three states, TODO, DONE, and CANCELLED. The pipe delimits incompleted states on the left from completed states on the right. With each state, I have given in parens a fast access key for use with
C-c C-tand the exclamation mark which signifies to always log the change when changing to this state.
A true value means that creating a to-do entry will trigger logging of a state change.
A value of nil means that state changes will be logged in chronological order, from top to bottom.
State changes will be logged into a drawer called
:LOGBOOK:. One can give a string value for this variable to change the name of the drawer, but the default is fine by me.
The nil value here turns off org's normal behavior of inserting the
CLOSED: [timestamp]line when an item is marked with a completed state. I don't want that line because I have already specified with
org-todo-keywordsthat all state changes are logged into a drawer.
This complex little form just defines the format for the state change log entries.
So there you have it, my org to-do config. It allows me to keep a
detailed record of my progress with to-do items. There are further tweaks
that could be made to
org-todo-keywords to improve it more,
specifically, using the
@ flag and the
/ special syntax, but what I
have already may be good enough. I will conclude this entry with an
example, showing what a completed to-do entry looks like in this
* DONE blog about org to-do config
- State -> "TODO" [2011-09-28 Wed]
- State -> "DONE" [2011-09-28 Wed]