[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to set up Gnus as default mailto application in Ubuntu?
From: |
Ashish SHUKLA |
Subject: |
Re: How to set up Gnus as default mailto application in Ubuntu? |
Date: |
Fri, 01 Feb 2013 09:57:26 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (amd64-portbld-freebsd9.1) |
Marius Hofert writes:
> Hi,
> When I click a "mailto-link" in google-chrome (on Ubuntu 12.10), thunderbird
> pops up as default application. I was wondering if one can do something
> similar
> as in the answer on
> ,----
> |
> http://askubuntu.com/questions/40004/changing-email-application-in-preferred-applications-to-gmail
> `----
> for setting up Gnus as default mailto-application under Ubuntu (?)
A proof-of-concept shell script like following should do the basic job, and
ofcourse it requires an Emacs instance running:
#v+
#!/bin/sh
ARG="$1"
if [ -z "$ARG" ]; then exit 0; fi
RECIPIENT=$(echo $ARG |sed -r -n -e
'/^mailto:/s/^mailto:([^@]+@[[:alnum:].-]+).*$/\1/gp')
SUBJECT="$(echo $ARG |sed -r -n -e
'/^mailto:/s/^mailto:[^@]+@[[:alnum:].-]+[?].*&?subject=([^&]+).*$/\1/gp')"
emacsclient -e '(progn (gnus-group-mail) (message-goto-to) (insert
"'$RECIPIENT'") (message-goto-subject) (insert "'"$SUBJECT"'")
(message-goto-body))'
#v-
If you prefer messages to be opened in new window then
s/emacsclient/emacsclient -c/.
HTH
--
Ashish SHUKLA
“Will this gun not make war more terrible? No, it will make war impossible.”
(Hudson Maxim, inventor of the machine gun, 1893)
Sent from my Emacs
pgpQ5eC5XCANj.pgp
Description: PGP signature