remember Mutt's mail in Org-mode and jump back to themAs already anticipated, I've been implementing my own Getting Things Done work flow. This post documents one of its main bricks: the integration between Mutt and Org-mode. As a geek, my main incoming stream of TODO items and information in general is email. As emails hit my INBOX, I either deal with them immediately (reply, archive, delete) or I need to store them elsewhere, possibly adding extra information such as a deadline, a personal note, the associated next action, the context in which it is actionable, etc. This need of adding extra information is what defeats the usage of my mail client (Mutt) as a list manager (in the GTD sense), and that's where I plugged Org-mode in. My main goals are:
In fact, both would be straightforward to achieve if I were using some Emacs-based mail client such as Gnus, but I resist the Emacs operating system syndrome, and therefore I insist in using my beloved Mutt. Let's see how the two parts of the interaction between Mutt and Org-mode work. (1) Mutt → Org-mode (there ...)The interaction from Mutt to Org-mode happens via org-protocol. Using it external applications can feed content to Org-mode note templates, which are then interactively edited (via emacsclient), and finally filed away. The Mutt glue macro from my
The remember-mail script is trivial: it parses the fed mail from STDIN (using a couple of legacy Perl modules) and then invokes org-protocol. The relevant configuration from my
The result is that when you hit (2) Org-mode → Mutt (... and back again)Going back means that clicking on a "mail" hyperlink within an Org-mode note should bring up a Mutt instance showing the original message, in its context (e.g. its own mailbox). Achieving that consists of 2 separate steps:
For the first part I use maildir-utils
(AKA mu): a
Xapian-based mail indexing tool, which nicely integrates with Mutt;
check out my
previous blog post on the subject for a sample setup. Using mu,
Note: I'm relying upon maildir-utils version 0.6 or greater, for all presented scripts. For the second part I use the mutt-open script which fires upon a Mutt instance on the maildir containing a specific message, and then "hits" the appropriate keys to open the message and shutdown the sidebar (if desired). It is a nicely reusable script, which I've being using elsewhere too. The needed glue on the emacs side is just a function to invoke
Voilà! DownloadSummary of scripts and configuration snippets discussed above:
Read available comments below or
add your own.
|
