Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* How to set up Gnus as default mailto application in Ubuntu?
@ 2013-01-31 18:40 Marius Hofert
  2013-02-01  4:27 ` Ashish SHUKLA
  2013-02-01 14:58 ` Teemu Likonen
  0 siblings, 2 replies; 9+ messages in thread
From: Marius Hofert @ 2013-01-31 18:40 UTC (permalink / raw)
  To: Gnus

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 (?)

Cheers,

Marius

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-01-31 18:40 How to set up Gnus as default mailto application in Ubuntu? Marius Hofert
@ 2013-02-01  4:27 ` Ashish SHUKLA
  2013-02-01  8:42   ` Marius Hofert
  2013-02-01 14:58 ` Teemu Likonen
  1 sibling, 1 reply; 9+ messages in thread
From: Ashish SHUKLA @ 2013-02-01  4:27 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Gnus


[-- Attachment #1.1: Type: text/plain, Size: 1249 bytes --]

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01  4:27 ` Ashish SHUKLA
@ 2013-02-01  8:42   ` Marius Hofert
  2013-02-01 17:56     ` Ashish SHUKLA
  0 siblings, 1 reply; 9+ messages in thread
From: Marius Hofert @ 2013-02-01  8:42 UTC (permalink / raw)
  To: Ashish SHUKLA; +Cc: Gnus

Hi Ashish,

Thanks a lot for helping.

How can I use the script?

google-chrome -> Settings -> Privacy -> Content settings... -> Handlers ->
Manage handlers... somehow does not allow to add scripts.

Cheers,

Marius

Ashish SHUKLA <wahjava.ml@gmail.com> writes:

> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-01-31 18:40 How to set up Gnus as default mailto application in Ubuntu? Marius Hofert
  2013-02-01  4:27 ` Ashish SHUKLA
@ 2013-02-01 14:58 ` Teemu Likonen
  2013-02-01 15:08   ` Marius Hofert
  1 sibling, 1 reply; 9+ messages in thread
From: Teemu Likonen @ 2013-02-01 14:58 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Gnus

Marius Hofert [2013-01-31 19:40:52 +0100] wrote:

> 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 [...] for setting up Gnus as default
> mailto-application under Ubuntu (?)

See:
http://www.emacswiki.org/emacs/MailtoHandler

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01 14:58 ` Teemu Likonen
@ 2013-02-01 15:08   ` Marius Hofert
  2013-02-01 16:16     ` Thierry Volpiatto
  0 siblings, 1 reply; 9+ messages in thread
From: Marius Hofert @ 2013-02-01 15:08 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: Gnus

Can you be a bit more specific (for a newbie), please?

The page says:

,----
| Configure your web browser and operating system so that the script is the default email application
`----

As I wrote, it is not clear to me, how I can tell google-chrome to accept a
script. 

Concerning Ubuntu, the only two choices for default mail apps are thunderbird
and Kmail (see System Settings -> Details -> Default Applications). I tried to
figure out how to change that and the only way I found works via editing
~/.local/share/applications/mimeapps.list. But what have to be the entries?
(x-scheme-handler/mailto=gnus (?)).

Cheers,

Marius


Teemu Likonen <tlikonen@iki.fi> writes:

> Marius Hofert [2013-01-31 19:40:52 +0100] wrote:
>
>> 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 [...] for setting up Gnus as default
>> mailto-application under Ubuntu (?)
>
> See:
> http://www.emacswiki.org/emacs/MailtoHandler

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01 15:08   ` Marius Hofert
@ 2013-02-01 16:16     ` Thierry Volpiatto
  2013-02-08 18:00       ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Thierry Volpiatto @ 2013-02-01 16:16 UTC (permalink / raw)
  To: info-gnus-english

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> Can you be a bit more specific (for a newbie), please?
>
> The page says:
>
> ,----
> | Configure your web browser and operating system so that the script is the default email application
> `----
>
> As I wrote, it is not clear to me, how I can tell google-chrome to accept a
> script. 
Don't know for google-chrome, but for firefox, it is possible, see
https://github.com/emacs-helm/helm/wiki#wiki-firefoxbookmarks

It is the same for gnus, with this script instead:

--8<---------------cut here---------------start------------->8---
#!/bin/bash

wmctrl -xa emacs
if [ -n $1 ]; then
    emacsclient -e "(message-mail (substring \"$1\" 7))"
else
    emacsclient -e "(message-mail)"
fi
--8<---------------cut here---------------end--------------->8---


-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01  8:42   ` Marius Hofert
@ 2013-02-01 17:56     ` Ashish SHUKLA
  2013-02-01 18:11       ` Marius Hofert
  0 siblings, 1 reply; 9+ messages in thread
From: Ashish SHUKLA @ 2013-02-01 17:56 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Gnus


[-- Attachment #1.1: Type: text/plain, Size: 711 bytes --]

Marius Hofert writes:
> Hi Ashish,

> Thanks a lot for helping.

> How can I use the script?

> google-chrome -> Settings -> Privacy -> Content settings... -> Handlers ->
> Manage handlers... somehow does not allow to add scripts.

> Cheers,

> Marius

I didn't look at the link you provided. I tested it with firefox, when I click
on 'mailto:' link it asks me which application i would like to open this
'mailto:' link with, and there I specified the path to my script.

HTH
-- 
Ashish SHUKLA

“There was truth and there was untruth, and if you clung to the truth even
against the whole world, you were not mad.” (George Orwell, "Nineteen
Eighty-Four", 1949)

Sent from my Emacs

[-- Attachment #1.2: Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01 17:56     ` Ashish SHUKLA
@ 2013-02-01 18:11       ` Marius Hofert
  0 siblings, 0 replies; 9+ messages in thread
From: Marius Hofert @ 2013-02-01 18:11 UTC (permalink / raw)
  To: Ashish SHUKLA; +Cc: Gnus

... Firefox is comparably easy, yes :-)


Ashish SHUKLA <wahjava.ml@gmail.com> writes:

> Marius Hofert writes:
>> Hi Ashish,
>
>> Thanks a lot for helping.
>
>> How can I use the script?
>
>> google-chrome -> Settings -> Privacy -> Content settings... -> Handlers ->
>> Manage handlers... somehow does not allow to add scripts.
>
>> Cheers,
>
>> Marius
>
> I didn't look at the link you provided. I tested it with firefox, when I click
> on 'mailto:' link it asks me which application i would like to open this
> 'mailto:' link with, and there I specified the path to my script.
>
> HTH

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to set up Gnus as default mailto application in Ubuntu?
  2013-02-01 16:16     ` Thierry Volpiatto
@ 2013-02-08 18:00       ` Reiner Steib
  0 siblings, 0 replies; 9+ messages in thread
From: Reiner Steib @ 2013-02-08 18:00 UTC (permalink / raw)
  To: info-gnus-english

On Fri, Feb 01 2013, Thierry Volpiatto wrote:

>     emacsclient -e "(message-mail (substring \"$1\" 7))"

      emacsclient -n --eval "(browse-url \"$@\")"


`browse-url' handles parameters like subject and body correctly.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-02-08 18:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 18:40 How to set up Gnus as default mailto application in Ubuntu? Marius Hofert
2013-02-01  4:27 ` Ashish SHUKLA
2013-02-01  8:42   ` Marius Hofert
2013-02-01 17:56     ` Ashish SHUKLA
2013-02-01 18:11       ` Marius Hofert
2013-02-01 14:58 ` Teemu Likonen
2013-02-01 15:08   ` Marius Hofert
2013-02-01 16:16     ` Thierry Volpiatto
2013-02-08 18:00       ` Reiner Steib

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).