]> git.donarmstrong.com Git - bin.git/blobdiff - remember_mail
add git-hogs command
[bin.git] / remember_mail
index eaf662c43d5531bfb13280d859a390b8b6e002cb..08d65e2d031f52b8307a42f5e5bceeff344329a8 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://m/mutt:$mid/mail/$note_body";