info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling mailto in firefox/iceweasel with gnus on linux


From: Richard Riley
Subject: Re: Handling mailto in firefox/iceweasel with gnus on linux
Date: Mon, 24 Aug 2009 21:14:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Richard Riley <rileyrgdev@gmail.com> writes:

> (Debian Linux and Gnome btw)
>
> I did some googling around for mailto solutions again recently from
> firefox - there are a few different approaches that worked with varying
> success on my setup (gnus-posting-styles). I think/hope I have cobbled
> other peoples work together and added a little more in a way which might
> help others too.
>
> 1) Install the mozex add on for firefox. Configure the mail handler with
> something along the lines of:
>
> ,----
> | /on/your/path/gnumail  %a %s
> `----
>
> 2) create the script gnumail referenced above which takes the mailto and
> extract the "to". Borrowed from
> http://www.emacswiki.org/emacs/MailtoHandler
>

Better is:

,----
| #!/bin/bash
| mailto=$(printf '%s\n' "$1" | sed -e 's/[\"]/\\&/g')
| elisp_expr=$(printf '(rgr/mailto "%s")' "$mailto")
| 
| emacsclient --alternate-editor="" -c -n \
|         --eval "$elisp_expr" \
|         --eval '(set-window-dedicated-p (selected-window) t)'
`----


>
> 3) Add the function to talk to gnus in your .emacs/wherever. This small
> function borrowed the completing read from John Sullivan's mailto from a
> while ago but also allows a pre-configured one with no prompt. It
> detects if Gnus is running and starts it if not.

Slight improvement: ensure you add it to your .emacs and not your .gnus
init file or it might not work if gnus is autoloaded and you have not
already loaded gnus at least once. In addition, added the "require" to
pull in gnus.

,----
| (setq gnus-default-mailto-group "INBOX.mail")
| 
| (defun rgr/mailto (to)
|   "Send an email to 'to' but prompting for a posting style if not configured. 
Starts Gnus if not already running."
|   (require 'gnus)
|   (unless gnus-active-hashtb (gnus)) ;; Better way??
|   (let ((gnus-newsgroup-name
|          (if gnus-default-mailto-group gnus-default-mailto-group 
(completing-read "Use posting style of group: "
|                           gnus-active-hashtb nil
|                           (gnus-read-active-file-p)))))
|     (compose-mail to)))
| 
`----

>
> And now with the wonders of emacs daemon (my "edit" function is simply
> 'emacsclient --alternate-editor="" -c $*') gnus pops up in a matter of
> milliseconds when I click on a mailto in iceweasel!
>
> cheers,
>
> r.
>
>

-- 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]