#! /bin/sh # # Script for spawning gnus' message composition under xemacs through # muttzilla. # # by Andrew J Cosgriff # based on the VM one # by Claus Brunzema # most code stolen from muttzilla's mzmail.sh # If you already have an xemacs with gnuserv running, this script # first tries to start message mode using that xemacs. Otherwise a # new xemacs is started. So, if you don't want a new xemacs for every # mail, put something like (gnuserv-start) in your .emacs. # Arguments to the script: # 1 to # 2 cc # 3 bcc # 4 subject # 5 body file # 6 org MZTO=$1 MZCC=$2 MZBCC=$3 MZSUB=$4 MZBOD=$5 MZORG=$6 ARGS="-eval '(progn (message-mail " if [ -n "$MZTO" ] ; then ARGS="$ARGS \"$MZTO\"" fi if [ -n "$MZSUB" ] ; then ARGS="\"$MZSUB\" " fi # # I'm too lazy to deal with CC and BCC now (ajc) # #if [ -n "$MZCC" ] ; then # ARGS="$ARGS (mail-cc) (insert \"$MZCC\") " #fi #if [ -n "$MZBCC" ] ; then # ARGS="$ARGS (mail-bcc) (insert \"$MZBCC\") " #fi ### body and org still missing ... ARGS="$ARGS ))'" if (gnuclient -batch -eval '(progn)' 2>&1 >/dev/null) ; then eval gnuclient $ARGS else eval xemacs $ARGS fi # This is an ugly hack, and to be honest I'm not even sure it does # what I think it does, but I hadn't really forseen that you might # want to spawn one of two programs depending on the results of some # test. I'm sure I'll hear from some enterprising VM users who will # let me know a better way. exit 0