#!/bin/sh
# Simple start-up script for qed to use from an mailer.
# Author: Guido Flohr <gufl0000@stud.uni-sb.de>
# This script requires qed version 3.90 or higher.
# You should install it as /usr/local/bin/mailqed and then edit
# your muttrc file.  Please insert a line:
#
#     set editor=/usr/local/bin/mailqed
#

# Comment these lines out after you've edited the script.
cat <<EOF
You have to edit the file $0 before you can start
Hit RETURN to continue!
EOF
read
exit 1

#### Start of configurable area! #########################################
# Set the environment variable QED to the path where qed is installed.
QED=/e/editor/qed; export QED

# Do you have GNU recode?  You should get it if you want to send and
# receive mails in non-english languages.  A port to MiNT can be found
# on almost every ftp server with Atari software.
# If you have recode then remove the comment from the next line and 
# indicate the path where recode can be found.
# RECODE=/usr/local/bin/recode
#### End of configurable area! ###########################################
##########################################################################

# Check if recode is installed.  Convert the file from ISO-latin1 charset
# to the Atari charset.  
test "$RECODE" && "$RECODE" latin1:atarist $*
# Call qed.
$QED/qed.app $*
# Recode the file back from the Atari charset to latin1.
test "$RECODE" && "$RECODE" atarist:latin1 $1
