X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=remember_mail;h=230848b9b57b486c581cc97c4b0ddcb2576df48f;hb=56c8d8b286ae38e170ce915472f9aa86fabf9fee;hp=eaf662c43d5531bfb13280d859a390b8b6e002cb;hpb=30d4236e86435ace233931412f1358e1bcc16812;p=bin.git diff --git a/remember_mail b/remember_mail index eaf662c..230848b 100755 --- a/remember_mail +++ b/remember_mail @@ -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";