Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!RODAN.ACS.SYR.EDU!jdpeek From: jdpeek@RODAN.ACS.SYR.EDU (Jerry Peek) Newsgroups: comp.mail.mh Subject: Re: news and mh Message-ID: <9003100910.AA16675@rodan.acs.syr.edu> Date: 10 Mar 90 10:10:20 GMT References: <7950@tank.uchicago.edu> Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 97 > Is there any way to call comp instead of rn's regular mailposter > when you reply to or post a message? I use rn (it's about all that's > available on the elxsi) and sometimes read news in emacs. Setting > environment variables for MAILPOSTER, etc., doesn't override rn's > natural beastiness. Any experience with this? I use it for replies. I set this up few years ago, in a hurry, and haven't touched it since. It seems to work fine... I've forgotten all the stuff I learned about 'rn' to make it work, though. :-) But maybe it'll give you a start. I put this in my .profile: RNINIT=$HOME/.rnswitches export RNINIT Here's my $HOME/.rnswitches file. You want MAILHEADER and MAILPOSTER, and the "-F", I think. I set the environment variables here in .rnswitches, instead of my .profile, because I don't want them cluttering up my environment when I'm not reading news: -d~/.news -EMAILHEADER="To: %f Subject: Re: %S Newsgroups: %n Fcc: inbox\\n\\n" -EMAILPOSTER="rn-ans -form %h" -F"> " -h +hfrom +hdate -2400-i=4 +4800-i=15 -m=u -N -S -t I made a symbolic link in my bin directory to "comp": $ ls -l rn-ans lrwxrwxrwx 1 jdpeek 18 Nov 1 1988 rn-ans -> /usr/local/mh/comp I put this line in my .mh_profile: rn-ans: -editor rn-ans.fixmsg And my brainless 'rn-ans.fixmsg' editor is after the line below. It basically just tacks a signature onto the draft file that 'rn' makes, then puts me into 'vi' five lines above the end of the message. When the script ends, I'm at a What now? prompt; I just "push" the reply. You could make a script like this do anything you want... --Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY jdpeek@rodan.acs.syr.edu, JDPEEK@SUNRISE.BITNET +1 315 443-3995 ------- CUT HERE FOR BRAINLESS EDITOR ------------------------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by rodan.acs.syr.edu!jdpeek on Sat Mar 10 04:04:07 EST 1990 # Contents: rn-ans.fixmsg echo extracting - rn-ans.fixmsg sed 's/^X//' > "rn-ans.fixmsg" <<'X//E*O*F rn-ans.fixmsg//' X#! /bin/sh X### rn-ans.fixmsg - editor for "r" and "R" commands in "rn" X### Usage in .mh_profile: rn-ans: -editor rn-ans.fixmsg X X# IF CAN FIND MAIL SIGNATURE, ADD IT TO END OF DRAFT: Xif [ -w "$1" ] Xthen X for f in $HOME/.Mail/mailend $HOME/.signature X do X if [ -r $f ] X then X cat $f >> "$1" X break X fi X done Xelse X echo "`basename $0`: can't write to draft '$1'. Quitting." 1>&2 X exit 1 Xfi X X# EDIT DRAFT WITH vi (IT BETTER NOT RETURN NON-ZERO OR DRAFT GETS ZAPPED?): Xexec vi +'$-5' $1 X//E*O*F rn-ans.fixmsg// chmod u=rw,g=,o= rn-ans.fixmsg echo Inspecting for damage in transit... temp=/tmp/shar$$; dtemp=/tmp/.shar$$ trap "rm -f $temp $dtemp; exit" 0 1 2 3 15 cat > $temp <<\!!! 22 89 492 /tmp/rn-ans.fixmsg !!! wc rn-ans.fixmsg | sed 's/^X//' | diff -b $temp - >$dtemp if [ -s $dtemp ] then echo "Ouch [diff of wc output]:" ; cat $dtemp else echo "No problems found." fi exit 0