Thread View: news.software.nn
4 messages
4 total messages
Started by ###.C.H.A.W.###
Thu, 07 May 1992 03:52
Marrying mh with nn---how?
Author: ###.C.H.A.W.###
Date: Thu, 07 May 1992 03:52
Date: Thu, 07 May 1992 03:52
8 lines
902 bytes
902 bytes
How does one tell nn to use mh as the mailer? Basically, I want nn to call the comp or repl command when I'm mailing from within nn. What's the best way to do this? Thanks, -Chaw
Re: Marrying mh with nn---how?
Author: ###.C.H.A.W.###
Date: Thu, 07 May 1992 06:34
Date: Thu, 07 May 1992 06:34
48 lines
2061 bytes
2061 bytes
Here's a solution, courtesy Jaap Vermeulen <jaap@sequent.com>:
[QUOTE:
Just to prove you *can* do it, I hacked the following together:
I added 'set mail-script /h/jaap/.nn/mail-script' to my init file.
Then I copied '/usr/local/lib/nn/aux' to /h/jaap/.nn/mail-script'. Next
I modified aux a little. Here is a diff of the modification:
*** /usr/local/lib/nn/aux Thu Apr 2 05:30:11 1992
--- /h/jaap/.nn/mail-script Wed May 6 22:49:55 1992
***************
*** 167,172
e*)
# call editor to enter at line $ED_LINE of work file
case `basename "${EDITOR-vi}"` in
vi|emacs|emacsclient )
# Berkeley vi display editor
--- 167,181 -----
e*)
# call editor to enter at line $ED_LINE of work file
+ DRAFTFOLDER=$HOME/Mail/drafts
+
+ number=`cd $DRAFTFOLDER; ls [0-9]* | sed -n '$p'`
+ number=`expr $number + 1`
+
+ cp $WORK $DRAFTFOLDER/$number
+ exec comp -editor "${EDITOR-vi}" -use -draftfolder $DRAFTFOLDER \
+ -draftmessage $number
+
case `basename "${EDITOR-vi}"` in
vi|emacs|emacsclient )
# Berkeley vi display editor
And this works for me (this mail message is the result :-). Although
this is a crude example, I hope it will give you an idea of what to
do. Good luck,
]
Worked for me too! :-)
-Chaw
Re: Marrying mh with nn---how?
Author: Jack Levy
Date: Fri, 08 May 1992 09:55
Date: Fri, 08 May 1992 09:55
26 lines
1234 bytes
1234 bytes
chaw@Xenon.Stanford.EDU (###.C.H.A.W.###) writes:
>How does one tell nn to use mh as the mailer? Basically, I want nn to call
>the comp or repl command when I'm mailing from within nn. What's the best
>way to do this?
>Thanks,
>-Chaw
I've done it this way:
1. In .nn/init add: set mailer nnmail
2. Somewhere in your default path put a script called `nnmail':
#! /bin/csh -f
cat $1 > `mhpath +`/draft
send -draft
I guess you could use sh instead of csh.
Jack Levy,
Computer Centre,
University College London.
Janet e-mail: ccaajrl@ucl.ac.uk
Re: Marrying mh with nn---how?
Author: Ray Davis
Date: Sat, 09 May 1992 20:07
Date: Sat, 09 May 1992 20:07
256 lines
7143 bytes
7143 bytes
>>How does one tell nn to use mh as the mailer?
Here is a shar file with some scripts and nn init file settings
which I use to interface nn and mh. You'll have to make them
work in your environment, and convert to sh or csh if needed.
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
# nnmh
# This archive created: Sat May 9 20:50:38 1992
export PATH; PATH=/bin:/usr/bin:$PATH
if test ! -d 'nnmh'
then
echo shar: "creating directory 'nnmh'"
mkdir 'nnmh'
fi
echo shar: "entering directory 'nnmh'"
cd 'nnmh'
echo shar: "extracting 'init'" '(613 characters)'
if test -f 'init'
then
echo shar: "will not over-write existing file 'init'"
else
sed 's/^ X//' << \SHAR_EOF > 'init'
X##### variables
X
Xset mailer nnsend
X
X##### key maps and macros
X
X# S - save article in an mh folder
Xmap show S macro 0
Xdefine 0
X:!!>~/.nnmh.tmp
Xsave-full "~/.nnmh.tmp"
Xprompt "Enter mh folder: "
X:!!nnmhsave ~/.nnmh.tmp
Xend
X
X# [ - delete message from an mh folder
Xmap show [ macro 1
Xdefine 1
X:!!>~/.nnmh.tmp
Xsave-full "~/.nnmh.tmp"
Xprompt "deleting message..."
X:!!nnmhdelete ~/.nnmh.tmp
Xprompt ""
Xnext-article
Xend
X
X# ] - refile message to a different mh folder
Xmap show ] macro 2
Xdefine 2
X:!!>~/.nnmh.tmp
Xsave-full "~/.nnmh.tmp"
Xprompt "Enter mh refile folder: "
X:!!nnmhrefile ~/.nnmh.tmp
Xprompt ""
Xnext-article
Xend
SHAR_EOF
if test 613 -ne "`wc -c < 'init'`"
then
echo shar: "error transmitting 'init'" '(should have been 613 characters)'
fi
fi
echo shar: "extracting 'nnm'" '(663 characters)'
if test -f 'nnm'
then
echo shar: "will not over-write existing file 'nnm'"
else
sed 's/^ X//' << \SHAR_EOF > 'nnm'
X#!/bin/ksh
X# nnm - read an mh mail folder with nn
X#
X(( $# == 0 )) && echo "usage: nnm folder ..." && exit
Xmhdir=`grep ^Path: ~/.mh_profile | awk '{ print $2 }'`
Xtrap '/bin/rm -f $tmp; exit' 0 1 2 3 15
Xfor folder
Xdo
X cd ~/$mhdir/$folder
X tmp=`basename $folder`
X if [ ! -s $tmp ]
X then
X >$tmp
X chmod 600 $tmp
X echo "Collecting $folder... \c"
X show +$folder 1-last 2>&1 |
X awk '/^>>> / { foldnum = $2; next }
X /^Subject:/ { print $0; print "Summary:", foldnum; next }
X { print $0 }' |
X sed 1d >$tmp
X fi
X if [ -s $tmp ]
X then
X echo "done."
X nn $tmp
X else
X echo No $folder is good $folder.
X fi
X /bin/rm -f $tmp
Xdone
SHAR_EOF
if test 663 -ne "`wc -c < 'nnm'`"
then
echo shar: "error transmitting 'nnm'" '(should have been 663 characters)'
fi
chmod +x 'nnm'
fi
echo shar: "extracting 'nnmhsave'" '(1630 characters)'
if test -f 'nnmhsave'
then
echo shar: "will not over-write existing file 'nnmhsave'"
else
sed 's/^ X//' << \SHAR_EOF > 'nnmhsave'
X#!/bin/ksh
X#
X# ***> link this file to nnmhsave, nnmhdelete and nnmhrefile
X#
X# nnmhsave - save nn article to an mh folder
X# nnmhdelete - delete a corresponding MH mail message
X# nnmhrefile - refile a corresponding MH mail message
X#
XMHDIR=~/.fo
Xme=`basename $0`
Xexport MHCONTEXT=context.$me
Xfolder=
Xnumber=
XTMP=$1
X
Xfunction get_fol_num {
X export IFS=' :'
X exec 3<$TMP
X while read -u3 head folder number
X do
X [ "$head" = "Summary" ] && return
X done
X print - "\007$me: error - not an nnmh style message\c"
X sleep 3
X exit 1
X}
X
Xfunction get_folder_name {
X read newfolder
X if [ ! "$newfolder" ]
X then
X print - "\007$me: no folder specified, not saved\c"
X exit 1
X fi
X if [ ! -d $MHDIR/$newfolder ]
X then
X print - "\007$me: folder does not exist, not saved\c"
X exit 1
X fi
X}
X
Xtrap "/bin/rm -f $TMP" 0 1 2 3 15
Xcase "$me" in
X nnmhsave)
X get_folder_name
X inc +$newfolder -file $TMP -truncate >/dev/null
X print - "$me: saved in +$newfolder\c"
X ;;
X nnmhdelete)
X get_fol_num
X rmm +$folder $number >/dev/null 2>&1
X if (( $? == 0 ))
X then
X print - "\r\n$me: message deleted (+$folder $number)\c"
X else
X print - "\r\n$me: message not deleted! (+$folder $number)\007\c"
X fi
X sleep 1
X ;;
X nnmhrefile)
X get_folder_name
X get_fol_num
X mark -zero -seq cur +$folder $number >/dev/null 2>&1
X if (( $? != 0 ))
X then
X print - "$me: message does not exist! (+$folder $number)\007\c"
X fi
X refile +$newfolder >/dev/null 2>&1
X if (( $? == 0 ))
X then
X print - "$me: message refiled in +$newfolder\c"
X else
X print - "$me: message not refiled in +$newfolder!\007\c"
X fi
X sleep 1
X ;;
Xesac
SHAR_EOF
if test 1630 -ne "`wc -c < 'nnmhsave'`"
then
echo shar: "error transmitting 'nnmhsave'" '(should have been 1630 characters)'
fi
chmod +x 'nnmhsave'
fi
echo shar: "extracting 'nnmsgs'" '(248 characters)'
if test -f 'nnmsgs'
then
echo shar: "will not over-write existing file 'nnmsgs'"
else
sed 's/^ X//' << \SHAR_EOF > 'nnmsgs'
X# nnmsgs - read msgs with nn
Xtmp=/tmp/nnmsgs$$
Xtrap "/bin/rm -f $tmp; exit" 0 1 2 3 15
Xecho "Collecting msgs... \c"
X~/bin/msgs | nawk -f ~/lib/nnmsgs.awk >$tmp
Xecho "done."
Xif [ -s $tmp ]
Xthen
X nn $tmp
Xelse
X echo No messages is good msgs.
Xfi
SHAR_EOF
if test 248 -ne "`wc -c < 'nnmsgs'`"
then
echo shar: "error transmitting 'nnmsgs'" '(should have been 248 characters)'
fi
chmod +x 'nnmsgs'
fi
echo shar: "extracting 'nnmsgs.awk'" '(139 characters)'
if test -f 'nnmsgs.awk'
then
echo shar: "will not over-write existing file 'nnmsgs.awk'"
else
sed 's/^ X//' << \SHAR_EOF > 'nnmsgs.awk'
XBEGIN {
X notfirsttime = 0;
X}
X/^\(Message/ {
X if (notfirsttime) {
X print "";
X } else {
X notfirsttime = 1;
X }
X}
X{
X print $0
X}
SHAR_EOF
if test 139 -ne "`wc -c < 'nnmsgs.awk'`"
then
echo shar: "error transmitting 'nnmsgs.awk'" '(should have been 139 characters)'
fi
fi
echo shar: "done with directory 'nnmh'"
cd ..
exit 0
# End of shell archive
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads