emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] integration between Org, remember, and Mutt


From: Stefano Zacchiroli
Subject: [Orgmode] integration between Org, remember, and Mutt
Date: Sat, 31 Oct 2009 18:12:57 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all,
  I'm new to Org, but I fell in love with it quite quickly :-) As my
mail user agent has nothing to do with Emacs---it is Mutt---I was envy
to integrate it with Org, and I've actually done that.

With this mail, I'm wondering whether there were past/alternative
success stories about Mutt <-> Org integration (I've found nothing on
the Web).

Also, if you like the proposed way to integration, I'm looking forward
for advices on where to document it so that other people can take
inspiration (and avoid reinventing wheels, as I might have done).

Mutt <-> Org integration
------------------------

The link between Mutt and Org is the Message-ID of emails that I store
in a set of recursive Maildirs.

Those mails are indexed by mu (http://code.google.com/p/mu0/), an
alternative to mairix and nmzmail that I find more convenient. Just in
case you wonder, mail indexes are updated regularly with the following
cron entry (which takes just a few seconds, usually):

  31  */2 *  *   *     on_ac_power && mu-index -q

The attached script mutt-open is able to fire up Mutt on a message
specified by Message-ID (or path, FWIW) by looking it up via
mu-find. After finding the path, the script basically guesses the
corresponding Maildir, run mutt on it, and by sending some keys (via the
"push" command) open the given mail.

>From Org-mode, I can then follow "mutt:" links by using the following in
my Emacs conf:

  ;; add support for "mutt:ID" links
  (org-add-link-type "mutt" 'open-mail-in-mutt)

  (defun open-mail-in-mutt (message)
    "Open a mail message in Mutt, inside a terminal.
  
  Message can be specified either by a path pointing inside a
  Maildir, or by Message-ID."
    (interactive "MPath or Message-ID: ")
    (shell-command
     (concat
      (format "x-terminal-emulator -e \"%s %s\""
            (substitute-in-file-name "$HOME/bin/mutt-open") message))))

Finally, I've a macro to remember in Org a mail that I'm reading in
mutt:

  macro index \eR "|~/bin/remember-mail\n"

The corresponding script remember-mail is in attachment. It just
extracts from the piped mail the needed info to invoke Org protocol
appropriately via emacsclient. The corresponding remember template is
trivially as follows:

  ("Mail" ?m "* %?\n\n  Source: %u, %c\n  %i" nil "Note (mail)")


Any comment is welcome!

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
address@hidden,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime

Attachment: mutt-open
Description: Text document

Attachment: remember-mail
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]