[<< | Prev | Index | Next | >>]

Friday, April 25, 2008

GTD with Mutt



[Plopped from a message I wrote elsewhere.]

Garrett*'s solution to his overflowing email box inspired me to take a few more steps in configuring mutt*. (For one I actually had to get the source compiling and download a patch that lets my mutt macros edit the header fields of an email message...) And so far I'm really happy with the result (as far as improved personal efficiency):

Now when I hit a number from 1-5 that message is immediately tagged with that "priority" and I am moved to the next message. This lets me do triage on my often-too-large inbox without having to nec. actually handle the message right away. Hitting p1 through p5 (two keys: 'p', '1') sets my current viewing filter to that priority, which is essentially like taking me to the associated virtual folder. At any time I can hit a different number (1-5) and the message is instantly "moved" to the other virtual folder (but since it's all just tagging, there's no real moving, and importantly the order of messages is preserved and I can always open up to a broader view to see multiple or all priorities at once, etc...). Hitting 0 removes the priority. My default view (which I get by hitting ';') shows me all unhandled messages with no priority. This is my triage view, and akin to my "inbox".

This is all layered on top of my existing scheme, which is that all incoming messages are marked as Flagged until I hit ' (single quote) which unmarks them. My default filters for all views only shows Flagged emails. So, when doing triage, my choices are: Hit 1-5 to assign the message to a priority for later handling, or hit single-quote to un-flag the message and call it done on the spot. Then I might hit p1 to view priority 1 items, and within there again I can hit 2-5 to move again, or single-quote to mark as done. This way even "done" messages, which by default I no longer see, still remember their last priority tag so I can if I wish see all done items from that priority, or all items in that priority whether done or not, etc.. (though I don't have special bindings for these rare cases, I could add them if I found some common needs).

As an aside, there is yet a separate "new" flag build into mutt which is cleared the moment I view the message. The main impact this has is the item is highlighted when I am looking at the index. Once I view it, it is no longer highlighted. But I still have to hit single-quote to un-flag it, which is what makes it actually go away from view. I have the double-quote key set to toggle that "new" flag so that on occasion I can re-highlight an item, but I rarely use this (especially now with the new scheme; now I would almost certainly just hit 1 for this item to move it into the p1 folder for immediate handling).

In any of these contexts, I can hit T to thread and t to un-thread, where the former just sorts all items from a common thread together and the latter is strict chronological. In the threading view, indentation arrows show how items are related in a sideways tree (See, e.g., this screenshot). Hitting "<" at any time sets my filter to "all", which means if I am on an item in p1 and see, say, only two items in the thread there, I can hit "<" and now I am still on the same message (this is key), but potentially in the middle of a very large associated thread (i.e., now I am seeing the rest of the thread which did not fall into the p1 category). Hitting 't' would leave me in the middle of all the messages that I received chronologically around that one, and so on. So, in other words, once I'm on a particular message, which I may find in a p1-p5 view, I can hit a key or two and see its surrounding context in various ways (by thread, by time, or by any specific filter I may type in...).

There is a rough logical sorting to the priorities, but I am using them as distinct categories as opposed to just "more" or "less" as follows:

1 - Handle asap
2 - In progress stuff, review regularly
3 - Things to handle soonish, but not super time sensitive
4 - Things to get to when 1-3 are empty and you're bored.
5 - Things you couldn't bring yourself to mark done but are unimportant..

Notably, 2 is qualitatively different from the rest in that 1 and 3 are all items to handle when I have the time (1 first) whereas 2 are items I cannot do anything on until something else happens. I need to review 2 regularly to see what can be done (obviously task dependancies are needed here, but as a compromise...) but generally the items in 2 are not actually waiting for me.

Anyway, there's nothing non-obvious in all of the above, but empirically it's working well and it's nice to have a #1 folder that is short and concise and this has helped me get those important things done faster by eliminating the distraction of the too-many other things that those items used to be intermixed in in my all-in-one inbox.

As always, that I can hit one or two keys to make these things happen and that they happen instantly is a huge deal; it allows me to triage all my inbox w/almost zero per-item time overhead beyond necessary comprehension on my part.


Addendum 4/26:

Here are my notes on getting mutt running in Ubuntu with the X-Label patch. Part of the issue is getting a version of mutt which is otherwise identical to what I already had, which means getting all of Ubuntu's patches, configuration, and compile-time flags:

	Sources from:

		http://packages.ubuntu.com/gutsy/mail/mutt

		- See right sidebar.  Need:

			mutt_1.5.15+20070412-1ubuntu1.diff.gz
			mutt_1.5.15+20070412-1ubuntu1.dsc
			mutt_1.5.15+20070412.orig.tar.gz

	Alternately, in the future, you can try:

		apt-get source mutt

	Unpack and apply Ubuntu diffs:

		dpkg-source -x mutt_1.5.15+20070412-1ubuntu1.dsc 

	-----------------------

	XLabel Patch from:
	
		http://home.uchicago.edu/~dgc/mutt/

	Apply XLabel patch..

		cd mutt-1.5.15+20070412/
		patch -p1 < ../patch-1.5.1.dgc.xlabel_ext.5

		- This partly fails...

			- just skip the doc files (hit enter) since they don't matter,
			- Fix the protos.h file by hand (it's just one line...)

		vi protos.h.rej protos.h
		rm protos.h.*

	This is necessary to prevent a conflict with Ubuntu's patches:

		rm PATCHES

	-----------------------

	Build:

		sudo apt-get build-dep mutt
		cd mutt-1.5.15+20070412
		dpkg-buildpackage -rfakeroot -b
	
	This will build a ../*.deb package file and a ../*.changes file, both which you can chuck, and also
		leaves the raw binary in obj*/mutt

And here are some of the related key bindings from my muttrc:


# 1 - Handle asap
# 2 - In progress stuff, review regularly
# 3 - Things to handle soonish, but not super time sensitive
# 4 - Things to get to when 1-3 are empty and you're bored.
# 5 - Things you couldn't bring yourself to mark done but are unimportant..
macro index   p0 "<limit>~F\n" "Show ALL unhandled messages."
macro index   p1 "<limit>~F ~y 1\n" "Show unhandled messages in priority 1."
macro index   p2 "<limit>~F ~y 2\n" "Show unhandled messages in priority 2."
macro index   p3 "<limit>~F ~y 3\n" "Show unhandled messages in priority 3."
macro index   p4 "<limit>~F ~y 4\n" "Show unhandled messages in priority 4."
macro index   p5 "<limit>~F ~y 5\n" "Show unhandled messages in priority 5."
macro index   \; "<limit>~F !~h X-Label\n" "Show unhandled, unprioretized messages"
macro index   \> "<limit>~z >20480\n" "Show messages over 20K"
macro index   \< "<limit>~A\n" "Show all messages"

macro index   t  ":set sort=threads\n" "Group index by threads"
macro index   T  ":set sort=mailbox-order\n" "Don't group by threads"

bind index \" toggle-new
bind index \' flag-message
bind pager \' flag-message

#
# Tagging / X-Label
#
# The nested quotes are a hack to get around an apparent bug in ifdef.
#
# The ifdef is VITAL because if edit-label is not available in the current
#   version of mutt, this macro will start deleting mail!
# 
# (This is if you want to use '1 instead of just 1 to mark it...)
#ifdef edit-label macro index "\\\'1" "'<edit-label>1\n'" "'Set priority (X-Label) of message to 1'"
ifdef edit-label macro index "1" "'<edit-label>1\n<next-undeleted>'" "'Set priority (X-Label) of message to 1'"
ifdef edit-label macro index "2" "'<edit-label>2\n<next-undeleted>'" "'Set priority (X-Label) of message to 2'"
ifdef edit-label macro index "3" "'<edit-label>3\n<next-undeleted>'" "'Set priority (X-Label) of message to 3'"
ifdef edit-label macro index "4" "'<edit-label>4\n<next-undeleted>'" "'Set priority (X-Label) of message to 4'"
ifdef edit-label macro index "5" "'<edit-label>5\n<next-undeleted>'" "'Set priority (X-Label) of message to 5'"
ifdef edit-label macro index "0" "'<edit-label>\n<next-undeleted>'" "'Clear priority (X-Label) of message'"
# Duplicate block w/index->pager, and display-message added since edit-label seems to return to index.
ifdef edit-label macro pager "1" "'<edit-label>1\n<next-undeleted><display-message>'" "'Set priority (X-Label) of message to 1'"
ifdef edit-label macro pager "2" "'<edit-label>2\n<next-undeleted><display-message>'" "'Set priority (X-Label) of message to 2'"
ifdef edit-label macro pager "3" "'<edit-label>3\n<next-undeleted><display-message>'" "'Set priority (X-Label) of message to 3'"
ifdef edit-label macro pager "4" "'<edit-label>4\n<next-undeleted><display-message>'" "'Set priority (X-Label) of message to 4'"
ifdef edit-label macro pager "5" "'<edit-label>5\n<next-undeleted><display-message>'" "'Set priority (X-Label) of message to 5'"
ifdef edit-label macro pager "0" "'<edit-label>\n<next-undeleted><display-message>'" "'Clear priority (X-Label) of message'"

Note the above all depends on the following line in my .procmailrc which Flags all incoming mail by default:



# Flag *all* incoming mail.  This is my
#  personal version of the "NEW" flag but which
#  is not automatically cleared by the mail clients:
:0 fhw
| formail -b -Y -i "X-Status: F"




[<< | Prev | Index | Next | >>]


Simon Funk / simonfunk@gmail.com