[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Handling mailto in firefox/iceweasel with gnus on linux
From: |
Richard Riley |
Subject: |
Handling mailto in firefox/iceweasel with gnus on linux |
Date: |
Mon, 24 Aug 2009 21:01:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
(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
,----
| #!/bin/bash
| mailto=$(printf '%s\n' "$1" | sed -e 's/[\"]/\\&/g')
| elisp_expr=$(printf '(rgr/mailto "%s")' "$mailto")
|
| emacsclient -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.
,----
|
|(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."
| (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.
- Handling mailto in firefox/iceweasel with gnus on linux,
Richard Riley <=