#!/bin/sh
# -*- shell-script -*-

# Copyright (C) 2006 Robert Widhopf-Fenk
#
# Author:      Robert Widhopf-Fenk
# Status:      Tested with XEmacs 21.4.19 & VM 7.19
# Keywords:    VM helpers
# X-URL:       http://www.robf.de/Hacking/elisp
# Version:     $Id$

# This is a wrapper shell script which can be used to pass mailto: links with
# the mozex Firefox plugin to VM.   
#
# Grab version 1.9.3 or higher from http://mozex.mozdev.org/installation.html
#
# In mozex you should give the path to this script with the %a and %s args, e.g.
#
#    /home/yourlogin/bin/vm-mail %a %s
#
# Set "cmd" below to your Emacs binary.  You have three choices.

# 1) XEmacs uncomment the next line 
#cmd=xemacs

# 2) GNU Emacs uncomment the next line  
#cmd=emacs

# 3) If you always have a VM-Emacs running you might consider to start gnuserv,
# by adding the following to the end of your ~/.vm
#
#   (if (not (gnuserv-running-p)) (gnuserv-start))
#
# This will allow you to connect to your running XEmacs with gnuclient and brings up a 
# composition buffer really instantly.  
cmd=gnuclient

$cmd -eval "(let (vm-frame-per-composition) (vm-mail \"$1\" \"$2\"))"
