X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=remember_mail;h=08d65e2d031f52b8307a42f5e5bceeff344329a8;hb=e3b0b42558d6ff2d6d9ab799c3db75f48932bf89;hp=eaf662c43d5531bfb13280d859a390b8b6e002cb;hpb=30d4236e86435ace233931412f1358e1bcc16812;p=bin.git diff --git a/remember_mail b/remember_mail index eaf662c..08d65e2 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://m/mutt:$mid/mail/$note_body";