[comp.unix.questions] rn macros

blu@hall.cray.com (Brian Utterback) (03/07/88)

I don't know if this is the right place for this, but here goes:

I am trying to write a macro for rn so that the default for the
"Mailbox format" message is n.
From the documentation I thought that
\040 %(%m=M?n:\040) 
would work.  However, I don't get far enough to try it.
When I get to the newsgroup selection level, a space gets
me the "Type h for help" message.

Any ideas?



-- 
Brian Utterback     |UUCP:{ihnp4!cray,sun!tundra}!hall!blu | Think of it as
Cray Research Inc.  |ARPA:blu%hall.cray.com@uc.msc.umn.edu |  evolution in
One Tara Blvd. #301 |                                      |     action
Nashua NH. 03062    |Tele:(603) 888-3083                   |

lwk@caen.engin.umich.edu (Lewis W Kellum) (08/26/89)

You can all breath now. After promising to collect and repost
peoples favorite rn macros many moons ago, I've finally done it.
 
Thanks to all who contributed! You are listed with your submissions
In case of duplicate submissions, I have only given credit to the 
first submitter.

I've successfully tried out the more complicated macros here, but rn
acts somewhat funny when they're *all* loaded. In many cases I've 
changed the key associated with a macro from what the author submitted
so I didn't have to worry about overlaps - mostly by adding a leading ':'.

There are also some  RNINIT file lines at the end as well.
Follow ups to news.software.b. 

                - Woody Kellum  lwk@caen.engin.umich.edu
  
----- CUT------- SNIP------HACK----------CHOP-----KARATE-------
# .rnmac file

# Save files in mh folder named for group
# This one came from the net sometime back.
# Don't remember who, though.

:mh  |/usr/new/lib/mh/rcvstore +.%C^J

#This is half-page-up, the same as 'u' on 'more' and 'less'; I got pissed
#when I was unsubscribed whenever I wanted to move back a little, forgetting
#that the rn pager was *not* the same as 'more'!  One drawback: 'u' is
#still 'unsubscribe' at ends of articles and between groups.
# Amos Shapir	amos@nsc.com
u %(%m=p?bd:u)

#This runs 'cn' - a command file that takes rn -s# -c and formats it by awk.
#(I have found no way to run this from the middle of an rn session).
# > rn -s15 -c | awk '$1 ~ /Unread/ { printf "%s\t%s\n", $5,$4 }'
#  Amos Shapir	amos@nsc.com
:cn !cn^J

#Junk-and-quit - when you want to just look at a few articles
#on each group.
#  Amos Shapir	amos@nsc.com
J jq 

# Save sources to a directory <news_group_name> in file <subject_line>
# be sure to edit the subject line! 
#
# This is one of mine.  -ed.
:w w ~/src/%C/%s 

# junk next article 
# Jef Poskanzer <jef@helios.ee.lbl.gov>
C	/./:j^J

# map the right bracket into the control-G because bracket is easier to type
# dave@Galaxia.Newport.RI.US (David H. Brierley)
] %(%m=p?^G:])

# kill all articles in the current group that were submitted by the author
# of the current article. 
# 
# kill da sucka! -Ed.
# dave@Galaxia.Newport.RI.US (David H. Brierley)
:t %(%m=[ap]?/%t/h\:j^J:t)

#	For large groups with many uninteresting (at least to me) articles.
#	It deletes everything upto and including the current article.
#	The idea is the following.  You walk through the pages of
#	subjectlines until you see an interesting article, say number 789.
#	then type 788, and z (zap).  Anything before 789 (from which you
#	have seen the subjectlines is junked and 789 is shown.  The point is
#	that any time you hit "=", rn shows you the subjectlines from the
#	start on.  This "refreshes" your overview.
#	Drawback: be careful if you use ^N search.  If you hit z at the
#	wrong time, it might junk articles from which you haven't seen the
#	subjectlines yet.
#
# wsinkees%tuewsd.uucp@nluug.nl (Kees Huizing)
:z ?.?j\n 

#	When you choose to read a newsgroup, it first shows the
#	subjectlines.  I don't like this "jumping in" nature of rn.
#
# wsinkees%tuewsd.uucp@nluug.nl (Kees Huizing)
y %(%m=n?=:)
\040 %(%m=n?=: ) 

#	This one doesn't work.  It should recover a subject, i.e. unjunk all
#	previous articles with the same subject.  The main problem of
#	reading news is not to drawn in the number of articles.  So I
#	learned to junk, zap (see above) and catch up (c) very easily.
#	Sometimes you change your mind (Hey, John McEnroe also writes on
#	this subject, perhaps it's more interesting than I thought).
#	Typing the sequence works, but apparently, the escape-s is not
#	expanded when you use it as a macro
#
# I fixed this -Ed.
# wsinkees%tuewsd.uucp@nluug.nl (Kees Huizing)
:U ?%s?r:M

#The following were submitted by Mark Brader <msb@sq.sq.com> 

# Change the "f", etc commands so they mark the message as read.  If I'm f'ing
# before I've gotten to the end of the article, it's because I already
# read it once and then M'd it.  Idea from Larry Wall when rn was new.
f	jf
F	jF
r	jr
R	jR
#Make / mean g when within an article, to agree with "more".  (This is
#one part that Berkeley got right.)  To get the regular behavior of /
#when within an article I have to type j/, but I can stand that.
/	%(%m=p?g:/) 

# Like c, but clears all cross-postings as well.
Jy	$?.?j^Jq
 
#To agree with real UNIX conventions on end-of-file.  Note that QQ is
#faster than qqq because it doesn't waste time finding the next news-
#group with news in it, if I'm in a newsgroup when I do .D.
^D	QQ
 
# Mail article to a friend or anyone 
:D^J	!nice -6 mail -s "n %C '%i' # sq: %a" friend@wherever >/dev/null &^J
:D^M	!nice -6 mail -s "n %C '%i' # sq: %a" friend@wherever >/dev/null &^J
:D@	!nice -6 mail -s "n %C '%i' # sq: %a # 

# Like K, except that the subject as placed in the KILL file is not
# preceded by ": *" and is not truncated to about 20 characters.  This
# macro does not work if the subject contains certain characters e.g. '.
KK	!(md %c; echo '/%s/:j' >>%c/KILL) &^J

# Like the preceding macro, except that what is placed in the KILL file
# is :=:j instead of :j on the subject.  This means that when the
# killing is going on, the full subject line will be displayed, so
# that you can see if you got a false hit.  The idea of using :=:j
# came from the net a few months ago; I don't remember who posted it.
K=	!(md %c; echo '/%s/:=:j' >>%c/KILL) &^J

# Lets me type a KILL file entry directly, without having to enter the
# editor as I would with ^K.
K:	!md %c; echo >>%c/KILL '/

# Removes the THRU line from the KILL file, so that if I then do Q
# and reenter the group, newly added KILL file entries will take effect.
K*	!(echo 'g/\\\^THRU/d'; echo w) | ed %c/KILL &^J
# REAL kill command
K^M	K
K^J	K
----- CUT------- SNIP------HACK----------CHOP-----KARATE-------
 
#--------------------------------------------------------------------------------------
# RININT file 
#--------------------------------------------------------------------------------------

#These go in your RNINIT file

# This gives you a more useful list of a newsgroup's
#contents. It's not mine, I stole it from somewhere???
#When you press the '=' key, the list generated is in this format...

#11234 Re: Some subject                                  ( 67) larry@focsys
#11235 Re: Some other bloody subject                     (  7) larry@focsys
#11236 Re: No subject                                    (117) larry@focsys
# 
# Purported to have come from Sweden. I like this one! -Ed.
#Larry Williamson  watmath!focsys!larry 
#with modifications by Mark Brader <msb@sq.sq.com>

-ESUBJLINE="\
 %(%[subject]                                             \
 =^\\(..............................................\\)?\
 %1:%[subject]) \
 %(%(%[lines]=^$?%z:  (%[lines]\\))= *\\(.....\\)$\\|\\(.*\\)?%0) \
 %(%(%f=(\\(.*[^ ].*\\))$?%1:%f)                   \
 =^\\(...................\\)?%1)"

#If you have a problem  saving messages to:

#	~/News/comp.unix.questions

#because of a 14 character filename limit,  save them to:

#	~/News/Comp/unix.questions

#Do this by placing:

-ESAVENAME="%`%X/savename %^C`"

#in $LIBDIR/rn/INIT, and my $LIBDIR/rn/savename script says:
#
#	:
#	# convert "Comp.lang.c" to "Comp/lang.c"
#	if [ $# -ne 1 ] ; then
#	    echo "usage: $0 Newsgroup" 1>&2
#	    exit 1
#	fi
#	echo "$1" | sed -e 's!\.!/!'
#	exit 0
#
#Chip Rosenthal / chip@vector.Dallas.TX.US 
----- CUT------- SNIP------HACK----------CHOP-----KARATE-------