]> git.donarmstrong.com Git - bin.git/commitdiff
add remember mail
authorDon Armstrong <don@donarmstrong.com>
Fri, 25 Jan 2013 05:51:09 +0000 (21:51 -0800)
committerDon Armstrong <don@donarmstrong.com>
Fri, 25 Jan 2013 05:51:09 +0000 (21:51 -0800)
remember_mail [new file with mode: 0755]

diff --git a/remember_mail b/remember_mail
new file mode 100755 (executable)
index 0000000..eaf662c
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+#
+# Helper for mutt to remember mails in Emacs' Org mode
+#
+# Copyright: © 2009-2010 Stefano Zacchiroli <zack@upsilon.cc> 
+# License: GNU General Public License (GPL), version 3 or above
+#
+# Example of mutt macro to invoke this hitting ESC-R (to be put in ~/.muttrc):
+#  macro index \eR "|~/bin/remember-mail\n"
+
+use strict;
+use Mail::Internet;
+use URI::Escape;
+
+my $msg = Mail::Internet->new(\*STDIN);
+$msg->head->get('message-id') =~ /^<(.*)>$/;
+my $mid = $1;
+my $subject = $msg->head->get('subject') || "";
+my $from = $msg->head->get('from') || "";
+chomp ($subject, $from);
+my $note_body = uri_escape("  Subject: $subject\n    From: $from");
+
+exec "emacsclient", "-t", "org-protocol://capture://m/mutt:$mid/mail/$note_body";