I use mailx with sam as my editor. I only have one instance of sam on
my workstation. It works like this:
I invoke mailx with the following command:
crt=50 PAGER=Bcat VISUAL=BB mailx
"crt=50" means if it's longer than 50 lines run it through the pager.
"PAGER=Bcat" means use Bcat (a shell script; see below) to display long messages.
"VISUAL=BB" means use BB (ditto) as the message editor
Then when I try to read a long message it appears in sam. When I
compose a message I can type "~v" and the message so far appears in
sam. I edit it until its perfect, select write, and go back to the
mailx window where I hit return and then send it. It's a mess, really,
but it beats mailtool and textedit (no characterization sufficiently
derogatory).
Now for my question: has anybody gotten <exch> to work reliably with
sam and 9term under Solaris? It seems to work for a while after
rebooting but then it doesn't work anymore. I poked through the code
to some X function about swapping selections and then I gave up. Also,
is it supposed to work to snarf in one 9term window and paste (the
snarfed text) into another? That never works for me.
-- Jonathan Shopiro
Merrill Lynch & Co.
Here are the shell scripts (simple modifications of B, both of them):
Bcat:
#!/bin/sh
file=$HOME/tmp/Bcat$$
files=$file
line="none"
if [ $# != 0 ]; then
echo 'usage: Bcat' 1>&2
exit 1
fi
dir=`/bin/pwd`
if [ "$USER" = "" ]; then
USER=$LOGNAME
fi
pipe=/tmp/.sam.$USER
if [ $DISPLAY != "" ]; then
pipe=$pipe.$DISPLAY
fi
if [ ! -r $pipe ]; then
echo `basename $0`": No pipe \""$pipe"\" to sam." 1>&2
exit 1
fi
cat - >$file
echo "B $files" >> $pipe
if [ $line != "none" ]; then
echo $line >> $pipe
fi
read dummy
BB:
#!/bin/sh
files=
line="none"
if [ $# = 0 ]; then
echo 'usage: BB [-nnnn] files...' 1>&2
exit 1
fi
dir=`/bin/pwd`
if [ "$USER" = "" ]; then
USER=$LOGNAME
fi
pipe=/tmp/.sam.$USER
if [ $DISPLAY != "" ]; then
pipe=$pipe.$DISPLAY
fi
if [ ! -r $pipe ]; then
echo `basename $0`": No pipe \""$pipe"\" to sam." 1>&2
exit 1
fi
for i in $*
do
case "$i" in
/*) files="$files $i"
;;
-*) line=`echo $i | sed 's/.//'`
;;
*) files="$files $dir/$i"
;;
esac
done
echo "B $files" >> $pipe
if [ $line != "none" ]; then
echo $line >> $pipe
fi
read dummy