librelist archives

« back to archive

emacs as external application for mailto urls

emacs as external application for mailto urls

From:
klaus schilling
Date:
2014-02-11 @ 09:45
is it possible to treat mailto urls by opening the GNU Emacs in a
message-mail buffer, with the ``To:'' header field filled in 
from the url?

     Klaus Schilling

Re: emacs as external application for mailto urls

From:
Eric Abrahamsen
Date:
2014-02-11 @ 09:57
klaus schilling <schilling.klaus@web.de> writes:

> is it possible to treat mailto urls by opening the GNU Emacs in a
> message-mail buffer, with the ``To:'' header field filled in 
> from the url?
>
>      Klaus Schilling

Yup, though it takes a little padding. Here's what I've got. First, in
.conkerorrc:

set_protocol_handler("mailto", make_file("~/bin/handle-mailto"));

And ~/bin/handle-mailto:

#!/usr/bin/bash
/usr/bin/emacsclient --no-wait --eval "(compose-mail \"${1#mailto:}\")"

So long as you've started the server in emacs, this works correctly for
me.

Hope that helps,
Eric