Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Invoking gnus as mail agent from opera
@ 2002-05-29 14:18 Christian Lemburg
  0 siblings, 0 replies; only message in thread
From: Christian Lemburg @ 2002-05-29 14:18 UTC (permalink / raw)


Since I did not find anything on how to invoke gnus as mail agent from
opera (for mailto links), I decided to post my solution for the next
person having this problem.

Sketch of the idea: opera invokes a perl wrapper script that
interpolates the mailto address into a call to gnuclient with a small
lisp helper function. Gnus is assumed to be already running.

Pieces:

1) my-mailto-handler.el:

(defun my-mailto-handler (mail-address)
  "Compose new mail, using MAIL-ADDRESS given" 
  (gnus-group-mail)
  (message-goto-to)
  (insert mail-address)
  (message-goto-body))



2) gnus-mailto.pl:

#!/usr/bin/perl -w

# small perl script for invoking gnus from opera on mailto: Urls
# author: Christian Lemburg <lemburg@aixonix.de>
# version: $Id: gnus-mailto.pl,v 1.1 2002/05/29 11:40:00 lemburg Exp $

# -------------------------------------------------- 
# setup
# -------------------------------------------------- 

# command to invoke emacs
my $emacs_command = "gnuclient";

# function to handle mailto URL taking email address as only argument
my $mailto_handler_function = "my-mailto-handler";

# email address to send mail to - the mailto argument from opera
my $email_address = $ARGV[0];


# -------------------------------------------------- 
# action
# -------------------------------------------------- 

# like: gnuclient -eval '(my-mailto-handler "try@bla")'

system($emacs_command, "-eval", qq{($mailto_handler_function "$email_address")});



3) opera preferences setting in Applications - Email Client:

gnus-mailto.pl


-- 
Christian Lemburg, <lemburg@aixonix.de>, http://www.clemburg.com/

 Experience is something you don't get until just after you need it.
 		-- Olivier


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-29 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-29 14:18 Invoking gnus as mail agent from opera Christian Lemburg

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).