]> git.donarmstrong.com Git - bin.git/blobdiff - remember_mail
use the new format for capture in remember-mail
[bin.git] / remember_mail
index eaf662c43d5531bfb13280d859a390b8b6e002cb..230848b9b57b486c581cc97c4b0ddcb2576df48f 100755 (executable)
@@ -20,4 +20,10 @@ 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";
+my @EMACS_OPTS;
+if (defined $ENV{DISPLAY} and length($ENV{DISPLAY})) {
+    @EMACS_OPTS = qw(-c)
+} else {
+    @EMACS_OPTS = qw(-t)
+}
+exec "emacsclient", @EMACS_OPTS, "org-protocol://capture?template=m&url=mutt:$mid&title=mail&body=$note_body";