This is a new archive version of TRN at patchlevel 3. The original posting took up Volume23, issues 60 to 73, with various problems. These files replace those issues. #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # Contents: artio.h bits.c trn.1.2 # Wrapped by rsalz@litchi.bbn.com on Fri Aug 23 16:38:50 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH echo If this archive is complete, you will see the following message: echo ' "shar: End of archive 2 (of 14)."' if test -f 'artio.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'artio.h'\" else echo shar: Extracting \"'artio.h'\" \(1464 characters\) sed "s/^X//" >'artio.h' <<'END_OF_FILE' X/* $Header: artio.h,v 4.3.3.2 91/01/16 02:20:49 davison Trn $ X * X * $Log: artio.h,v $ X * Revision 4.3.3.2 91/01/16 02:20:49 davison X * Added optional prototyping. X * X * Revision 4.3.3.1 90/07/21 20:12:10 davison X * Initial Trn Release X * X * Revision 4.3.2.2 89/11/27 01:27:53 sob X * Altered NNTP code per ideas suggested by Bela Lubkin X * X * X * Revision 4.3.2.1 89/11/26 22:41:24 sob X * Added RRN support X * X * Revision 4.3 85/05/01 11:35:43 lwall X * Baseline for release with 4.3bsd. X * X */ X XEXT ART_POS artpos INIT(0); /* byte position in article file */ X XEXT ART_LINE artline INIT(0); /* current line number in article file */ XEXT FILE *artfp INIT(Nullfp); /* current article file pointer */ XEXT ART_NUM openart INIT(0); /* what is the currently open article number? */ X#ifdef LINKART X EXT char *linkartname INIT(nullstr);/* real name of article for Eunice */ X#endif X#ifdef SERVER XEXT ART_PART openpart INIT(0); /* how much of that article do we have? */ XFILE *nntpopen ANSI((ART_NUM,ART_PART)); X /* get an article unless already retrieved */ Xvoid nntpclose ANSI((void)); X/* MUST be in increasing order of completeness! */ X#define GET_STATUS 1 /* test for existence only */ X#define GET_HEADER 2 /* if only header items are desired */ X#define GET_ARTICLE 3 /* retreive full article */ X#endif X Xvoid artio_init ANSI((void)); XFILE *artopen ANSI((ART_NUM)); /* open an article unless already opened */ END_OF_FILE if test 1464 -ne `wc -c <'artio.h'`; then echo shar: \"'artio.h'\" unpacked with wrong size! fi # end of 'artio.h' fi if test -f 'bits.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'bits.c'\" else echo shar: Extracting \"'bits.c'\" \(17700 characters\) sed "s/^X//" >'bits.c' <<'END_OF_FILE' X/* $Header: bits.c,v 4.3.3.2 91/01/16 02:29:48 davison Trn $ X * X * $Log: bits.c,v $ X * Revision 4.3.3.2 91/01/16 02:29:48 davison X * Integrated rn patches 48-54. X * X * Revision 4.3.3.1 90/06/20 22:36:24 davison X * Initial Trn Release X * X * Revision 4.3.2.5 90/11/22 13:47:16 sob X * Altered #endifs to make System V compiliers happy. X * X * Revision 4.3.2.4 90/10/06 11:55:33 sob X * Added fix for DBM support. X * X * Revision 4.3.2.3 89/11/28 01:52:02 sob X * Removed some lint. X * X * Revision 4.3.2.2 89/11/27 01:30:04 sob X * Altered NNTP code per ideas suggested by Bela Lubkin X * X * X * Revision 4.3.1.4 86/10/31 15:23:53 lwall X * Separated firstart into two variables so KILL on new articles won't X * accidentally mark articles read. X * X * Revision 4.3.1.3 86/09/09 16:01:43 lwall X * Fixed 'n more articles' bug. X * X * Revision 4.3.1.2 86/07/24 14:40:23 lwall X * Gets host name from path instead of relay-version for news 2.10.3. X * X * Revision 4.3.1.1 85/05/10 11:31:41 lwall X * Branch for patches. X * X * Revision 4.3 85/05/01 11:36:15 lwall X * Baseline for release with 4.3bsd. X * X */ X X#include "EXTERN.h" X#include "common.h" X#include "rcstuff.h" X#include "head.h" X#include "util.h" X#include "final.h" X#include "rn.h" X#include "cheat.h" X#include "ng.h" X#include "artio.h" X#include "intrp.h" X#include "ngdata.h" X#include "rcln.h" X#include "kfile.h" X#ifdef USETHREADS X#include "rthreads.h" X#endif X#include "INTERN.h" X#include "bits.h" X X#ifdef DBM X# ifdef NULL X# undef NULL X# endif X# include X#endif XMEM_SIZE ctlsize; /* size of bitmap in bytes */ X Xvoid Xbits_init() X{ X#ifdef DELAYMARK X dmname = savestr(filexp(RNDELNAME)); X#else X ; X#endif X} X X/* checkpoint the .newsrc */ X Xvoid Xcheckpoint_rc() X{ X#ifdef DEBUGGING X if (debug & DEB_CHECKPOINTING) { X fputs("(ckpt)",stdout); X fflush(stdout); X } X#endif X if (doing_ng) X restore_ng(); /* do not restore M articles */ X if (rc_changed) X write_rc(); X#ifdef DEBUGGING X if (debug & DEB_CHECKPOINTING) { X fputs("(done)",stdout); X fflush(stdout); X } X#endif X} X X/* reconstruct the .newsrc line in a human readable form */ X Xvoid Xrestore_ng() X{ X register char *s, *mybuf = buf; X register ART_NUM i; X ART_NUM count=0; X int safelen = LBUFLEN - 16; X X strcpy(buf,rcline[ng]); /* start with the newsgroup name */ X s = buf + rcnums[ng] - 1; /* use s for buffer pointer */ X *s++ = rcchar[ng]; /* put the requisite : or !*/ X *s++ = ' '; /* put the not-so-requisite space */ X for (i=1; i<=lastart; i++) { /* for each article in newsgroup */ X if (s-mybuf > safelen) { /* running out of room? */ X safelen *= 2; X if (mybuf == buf) { /* currently static? */ X *s = '\0'; X mybuf = safemalloc((MEM_SIZE)safelen + 16); X strcpy(mybuf,buf); /* so we must copy it */ X s = mybuf + (s-buf); X /* fix the pointer, too */ X } X else { /* just grow in place, if possible */ X char *newbuf; X X newbuf = saferealloc(mybuf,(MEM_SIZE)safelen + 16); X s = newbuf + (s-mybuf); X mybuf = newbuf; X } X } X if (!was_read(i)) /* still unread? */ X count++; /* then count it */ X else { /* article was read */ X ART_NUM oldi; X X sprintf(s,"%ld",(long)i); /* put out the min of the range */ X s += strlen(s); /* keeping house */ X oldi = i; /* remember this spot */ X do i++; while (i <= lastart && was_read(i)); X /* find 1st unread article or end */ X i--; /* backup to last read article */ X if (i > oldi) { /* range of more than 1? */ X sprintf(s,"-%ld,",(long)i); X /* then it out as a range */ X s += strlen(s); /* and housekeep */ X } X else X *s++ = ','; /* otherwise, just a comma will do */ X } X } X if (*(s-1) == ',') /* is there a final ','? */ X s--; /* take it back */ X *s++ = '\0'; /* and terminate string */ X#ifdef DEBUGGING X if (debug & DEB_NEWSRC_LINE && !panic) { X printf("%s: %s\n",rcline[ng],rcline[ng]+rcnums[ng]) FLUSH; X printf("%s\n",mybuf) FLUSH; X } X#endif X free(rcline[ng]); /* return old rc line */ X if (mybuf == buf) { X rcline[ng] = safemalloc((MEM_SIZE)(s-buf)+1); X /* grab a new rc line */ X strcpy(rcline[ng], buf); /* and load it */ X } X else { X mybuf = saferealloc(mybuf,(MEM_SIZE)(s-mybuf)+1); X /* be nice to the heap */ X rcline[ng] = mybuf; X } X *(rcline[ng] + rcnums[ng] - 1) = '\0'; X if (rcchar[ng] == NEGCHAR) { /* did they unsubscribe? */ X printf(unsubto,ngname) FLUSH; X toread[ng] = TR_UNSUB; /* make line invisible */ X } X else X /*NOSTRICT*/ X toread[ng] = (ART_UNREAD)count; /* remember how many unread there are */ X} X X/* mark an article unread, keeping track of toread[] */ X Xvoid Xonemore(artnum) XART_NUM artnum; X{ X#ifdef DEBUGGING X if (debug && artnum < firstbit) { X printf("onemore: %d < %d\n",artnum,firstbit) FLUSH; X return; X } X#endif X if (ctl_read(artnum)) { X ctl_clear(artnum); X ++toread[ng]; X } X} X X/* mark an article read, keeping track of toread[] */ X Xvoid Xoneless(artnum) XART_NUM artnum; X{ X#ifdef DEBUGGING X if (debug && artnum < firstbit) { X printf("oneless: %d < %d\n",artnum,firstbit) FLUSH; X return; X } X#endif X if (!ctl_read(artnum)) { X ctl_set(artnum); X if (toread[ng] > TR_NONE) X --toread[ng]; X } X} X X/* mark an article as unread, making sure that firstbit is properly handled */ X/* cross-references are left as read in the other newsgroups */ X Xvoid Xunmark_as_read() X{ X check_first(art); X#ifdef USETHREADS X /* Keep selected_count accurate */ X if (ctl_read(art)) { X find_article(art); X if (p_art) { X if (selected_roots[p_art->root]) { X selected_count++; X } X root_article_cnts[p_art->root] = 1; X } else X unthreaded++; X } X scan_all_roots = FALSE; X#endif X onemore(art); X#ifdef MCHASE X if (!parse_maybe(art)) X chase_xrefs(art,FALSE); X#endif X} X X#ifdef USETHREADS X/* mark an article as read in this newsgroup only */ X Xvoid Xset_read(artnum,sel) XART_NUM artnum; Xint sel; X{ X if (!ctl_read(artnum)) { X oneless(artnum); X if( p_art->subject != -1 ) X selected_count -= sel; X } X} X X/* mark an article as unread in this newsgroup only */ X Xvoid Xset_unread(artnum,sel) XART_NUM artnum; Xint sel; X{ X if (artnum >= absfirst) { X check_first(artnum); X if (ctl_read(artnum)) { X onemore(artnum); X selected_count += sel; X root_article_cnts[p_art->root] = 1; X scan_all_roots = FALSE; X } X } X} X#endif X X#ifdef DELAYMARK X/* temporarily mark article as read. When newsgroup is exited, articles */ X/* will be marked as unread. Called via M command */ X Xvoid Xdelay_unmark(artnum) XART_NUM artnum; X{ X if (dmfp == Nullfp) { X dmfp = fopen(dmname,"w+"); X if (dmfp == Nullfp) { X printf(cantcreate,dmname) FLUSH; X sig_catcher(0); X } X } X#ifdef USETHREADS X /* Keep selected_count accurate */ X if (!ctl_read(artnum)) { X find_article(artnum); X if (p_art) { X if (selected_roots[p_art->root]) X selected_count--; X } else X unthreaded--; X } X#endif X oneless(artnum); /* set the correct bit */ X dmcount++; X fprintf(dmfp,"%ld\n",(long)artnum); X} X#endif X X/* mark article as read. If article is cross referenced to other */ X/* newsgroups, mark them read there also. */ X Xvoid Xmark_as_read() X{ X#ifdef USETHREADS X /* Keep selected_count accurate */ X if (!ctl_read(art)) { X find_article(art); X if (p_art) { X if (selected_roots[p_art->root]) X selected_count--; X } else X unthreaded--; X } X#endif X oneless(art); /* set the correct bit */ X checkcount++; /* get more worried about crashes */ X chase_xrefs(art,TRUE); X} X X/* make sure we have bits set correctly down to firstbit */ X Xvoid Xcheck_first(min) XART_NUM min; X{ X register ART_NUM i = firstbit; X X if (min < absfirst) X min = absfirst; X if (min < i) { X for (i--; i>=min; i--) X ctl_set(i); /* mark as read */ X firstart = firstbit = min; X } X} X X/* bring back articles marked with M */ X X#ifdef DELAYMARK Xvoid Xyankback() X{ X if (dmfp) { /* delayed unmarks pending? */ X#ifdef VERBOSE X printf("\nReturning %ld Marked article%s...\n",(long)dmcount, X dmcount == 1 ? nullstr : "s") FLUSH; X#endif X rewind(dmfp); X while (fgets(buf,sizeof buf,dmfp) != Nullch) { X art = (ART_NUM)atol(buf); X unmark_as_read(); X } X fclose(dmfp); X dmfp = Nullfp; X UNLINK(dmname); /* and be tidy */ X } X dmcount = 0; X} X#endif X X/* run down xref list and mark as read or unread */ X Xint Xchase_xrefs(artnum,markread) XART_NUM artnum; Xint markread; X{ X#ifdef ASYNC_PARSE X if (parse_maybe(artnum)) /* make sure we have right header */ X return -1; X#endif X#ifdef DBM X { X datum lhs, rhs; X datum fetch(); X register char *idp; X char *ident_buf; X static FILE * hist_file = Nullfp; X#else X if ( X#ifdef DEBUGGING X debug & DEB_FEED_XREF || X#endif X htype[XREF_LINE].ht_minpos >= 0) { X /* are there article# xrefs? */ X#endif /* DBM */ X char *xref_buf, *curxref; X register char *xartnum; X char *rver_buf = Nullch; X static char *inews_site = Nullch; X register ART_NUM x; X char tmpbuf[128]; X long pos; X X#ifdef DBM X rver_buf = fetchlines(artnum,NGS_LINE); X /* get Newsgroups */ X if (!index(rver_buf,',')) /* if no comma, no Xref! */ X return 0; X if (hist_file == Nullfp) { /* Init. file accesses */ X#ifdef DEBUGGING X if (debug) X printf ("chase_xref: opening files\n"); X#endif X dbminit(filexp(ARTFILE)); X if ((hist_file = fopen (filexp(ARTFILE), "r")) == Nullfp) X return 0; X } X xref_buf = safemalloc((MEM_SIZE)BUFSIZ); X ident_buf = fetchlines(artnum,MESSID_LINE); X /* get Message-ID */ X#ifdef DEBUGGING X if (debug) X printf ("chase_xref: Message-ID: %s\n", ident_buf); X#endif X idp = ident_buf; X while (*++idp) /* make message-id case insensitive */ X if (isupper(*idp)) X *idp = tolower (*idp); X lhs.dptr = ident_buf; /* look up article by id */ X lhs.dsize = strlen(lhs.dptr) + 1; X rhs = fetch(lhs); /* fetch the record */ X if (rhs.dptr == NULL) /* if null, nothing there */ X goto wild_goose; X bcopy((void *)rhs.dptr,(void *)&pos, 4); X fseek (hist_file, pos, 0); X /* datum returned is position in hist file */ X fgets (xref_buf, BUFSIZ, hist_file); X#ifdef DEBUGGING X if (debug) X printf ("Xref from history: %s\n", xref_buf); X#endif X curxref = cpytill(tmpbuf, xref_buf, '\t') + 1; X curxref = cpytill(tmpbuf, curxref, '\t') + 1; X#ifdef DEBUGGING X if (debug) X printf ("chase_xref: curxref: %s\n", curxref); X#endif X#else /* !DBM */ X#ifdef DEBUGGING X if (htype[XREF_LINE].ht_minpos >= 0) X#endif X xref_buf = fetchlines(artnum,XREF_LINE); X /* get xrefs list */ X#ifdef DEBUGGING X else { X xref_buf = safemalloc((MEM_SIZE)100); X printf("Give Xref: ") FLUSH; X gets(xref_buf); X } X#endif X#ifdef DEBUGGING X if (debug & DEB_XREF_MARKER) X printf("Xref: %s\n",xref_buf) FLUSH; X#endif X curxref = cpytill(tmpbuf,xref_buf,' ') + 1; X X /* Make sure site name on Xref matches what inews thinks site is. X * Check first against last inews_site. If it matches, fine. X * If not, fetch inews_site from current Relay-Version line and X * check again. This is so that if the new administrator decides X * to change the system name as known to inews, rn will still do X * Xrefs correctly--each article need only match itself to be valid. X */ X if (inews_site == Nullch || strNE(tmpbuf,inews_site)) { X#ifndef NORELAY X char *t; X#endif X if (inews_site != Nullch) X free(inews_site); X#ifndef NORELAY X rver_buf = fetchlines(artnum,RVER_LINE); X if ((t = instr(rver_buf,"; site ")) == Nullch) X#else /* NORELAY */ X /* In version 2.10.3 of news or afterwards, the Relay-Version X * and Posting-Version header lines have been removed. For X * the code below to work as intended, I have modified it to X * extract the first component of the Path header line. This X * should give the same effect as did the old code with respect X * to the use of the Relay-Version site name. X */ X rver_buf = fetchlines(artnum,PATH_LINE); X if (instr(rver_buf,"!") == Nullch) X#endif /* NORELAY */ X inews_site = savestr(nullstr); X else { X char new_site[128]; X X#ifndef NORELAY X cpytill(new_site,t + 7,'.'); X#else /* NORELAY */ X cpytill(new_site,rver_buf,'!'); X#endif /* NORELAY */ X inews_site = savestr(new_site); X } X if (strNE(tmpbuf,inews_site)) { X#ifdef DEBUGGING X if (debug) X printf("Xref not from %s--ignoring\n",inews_site) FLUSH; X#endif X goto wild_goose; X } X } X#endif /* DBM */ X while (*curxref) { X /* for each newsgroup */ X curxref = cpytill(tmpbuf,curxref,' '); X#ifdef DBM X xartnum = index(tmpbuf,'/'); X#else X xartnum = index(tmpbuf,':'); X#endif /* DBM */ X if (!xartnum) /* probably an old-style Xref */ X break; X *xartnum++ = '\0'; X if (strNE(tmpbuf,ngname)) {/* not the current newsgroup? */ X x = atol(xartnum); X if (x) X if (markread) { X if (addartnum(x,tmpbuf)) X goto wild_goose; X } X#ifdef MCHASE X else X subartnum(x,tmpbuf); X#endif X } X while (*curxref && isspace(*curxref)) X curxref++; X } X wild_goose: X free(xref_buf); X#ifdef DBM X free(ident_buf); X#endif /* DBM */ X if (rver_buf != Nullch) X free(rver_buf); X } X return 0; X} X Xint Xinitctl() X{ X char *mybuf = buf; /* place to decode rc line */ X register char *s, *c, *h; X register long i; X register ART_NUM unread; X X#ifdef DELAYMARK X dmcount = 0; X#endif X if ((lastart = getngsize(ng)) < 0) /* this cannot happen (laugh here) */ X return -1; X X absfirst = getabsfirst(ng,lastart); /* remember first existing article */ X if (!absfirst) /* no articles at all? */ X absfirst = 1; /* pretend there is one */ X#ifndef lint X ctlsize = (MEM_SIZE)(OFFSET(lastart)/BITSPERBYTE+20); X#endif /* lint */ X ctlarea = safemalloc(ctlsize); /* allocate control area */ X X /* now modify ctlarea to reflect what has already been read */ X X for (s = rcline[ng] + rcnums[ng]; *s == ' '; s++) ; X /* find numbers in rc line */ X i = strlen(s); X#ifndef lint X if (i >= LBUFLEN-2) /* bigger than buf? */ X mybuf = safemalloc((MEM_SIZE)(i+2)); X#endif /* lint */ X strcpy(mybuf,s); /* make scratch copy of line */ X mybuf[i++] = ','; /* put extra comma on the end */ X mybuf[i] = '\0'; X s = mybuf; /* initialize the for loop below */ X if (strnEQ(s,"1-",2)) { /* can we save some time here? */ X firstbit = atol(s+2)+1; /* ignore first range thusly */ X s=index(s,',') + 1; X } X else X firstbit = 1; /* all the bits are valid for now */ X if (absfirst > firstbit) { /* do we know already? */ X firstbit = absfirst; /* no point calling getngmin again */ X } X else if (artopen(firstbit) == Nullfp) { X /* first unread article missing? */ X i = getngmin(".",firstbit); /* see if expire has been busy */ X if (i) { /* avoid a bunch of extra opens */ X firstbit = i; X } X } X firstart = firstbit; /* firstart > firstbit in KILL */ X#ifdef PENDING X# ifdef CACHESUBJ X subj_to_get = firstbit; X# endif X#endif X unread = lastart - firstbit + 1; /* assume this range unread */ X for (i=OFFSET(firstbit)/BITSPERBYTE; i lastart) X max = lastart; X if (min <= max) /* non-null range? */ X unread -= max - min + 1;/* adjust unread count */ X for (i=min; i<=max; i++) /* for all articles in range */ X ctl_set(i); /* mark them read */ X } X else if ((i = atol(s)) >= firstbit && i <= lastart) { X /* is single number reasonable? */ X ctl_set(i); /* mark it read */ X unread--; /* decrement articles to read */ X } X#ifdef DEBUGGING X if (debug & DEB_CTLAREA_BITMAP) { X printf("\n%s\n",s) FLUSH; X for (i=1; i <= lastart; i++) X if (! was_read(i)) X printf("%ld ",(long)i) FLUSH; X } X#endif X } X#ifdef DEBUGGING X if (debug & DEB_CTLAREA_BITMAP) { X fputs("\n(hit CR)",stdout) FLUSH; X gets(cmd_buf); X } X#endif X if (mybuf != buf) X free(mybuf); X toread[ng] = unread; X return 0; X} X Xvoid Xgrow_ctl(newlast) XART_NUM newlast; X{ X ART_NUM tmpfirst; X MEM_SIZE newsize; X register ART_NUM i; X X forcegrow = FALSE; X if (newlast > lastart) { X ART_NUM tmpart = art; X#ifndef lint X newsize = (MEM_SIZE)(OFFSET(newlast)/BITSPERBYTE+2); X#else X newsize = Null(MEM_SIZE); X#endif /* lint */ X if (newsize > ctlsize) { X newsize += 20; X ctlarea = saferealloc(ctlarea,newsize); X ctlsize = newsize; X } X toread[ng] += (ART_UNREAD)(newlast-lastart); X for (i=lastart+1; i<=newlast; i++) X ctl_clear(i); /* these articles are unread */ X#ifdef CACHESUBJ X if (subj_list != Null(char**)) { X#ifndef lint X subj_list = (char**)saferealloc((char*)subj_list, X (MEM_SIZE)((OFFSET(newlast)+2)*sizeof(char *)) ); X#endif /* lint */ X for (i=lastart+1; i<=newlast; i++) X subj_list[OFFSET(i)] = Nullch; X } X#endif X tmpfirst = lastart+1; X lastart = newlast; X#ifdef KILLFILES X#ifdef VERBOSE X IF(verbose) X sprintf(buf, X "%ld more article%s arrived--looking for more to kill...\n\n", X (long)(lastart - tmpfirst + 1), X (lastart > tmpfirst ? "s have" : " has" ) ); X ELSE /* my, my, how clever we are */ X#endif X#ifdef TERSE X strcpy(buf, "More news--killing...\n\n"); X#endif X kill_unwanted(tmpfirst,buf,TRUE); X#endif X art = tmpart; X } X} X END_OF_FILE if test 17700 -ne `wc -c <'bits.c'`; then echo shar: \"'bits.c'\" unpacked with wrong size! fi # end of 'bits.c' fi if test -f 'trn.1.2' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'trn.1.2'\" else echo shar: Extracting \"'trn.1.2'\" \(42762 characters\) sed "s/^X//" >'trn.1.2' <<'END_OF_FILE' X.Ip ^G 8 XThis is a special version of the \*(L'g\*(R' command that is for skipping Xarticles in a digest. XIt is equivalent to setting \*(L"\-g4\*(R" and then executing the command X\*(L"g^Subject:\*(R". X.Ip TAB 8 XThis is another special version of the \*(L'g\*(R' command that is for Xskipping inclusions of older articles. XIt is equivalent to setting \*(L"\-g4\*(R" and then executing the command X\*(L"g^[^c]\*(R", where \fIc\fR is the first character of the last line Xon the screen. XIt searches for the first line that doesn't begin with the same character Xas the last line on the screen. X.Ip !command 8 XEscape to a subshell. X.PP XThe following commands skip the rest of the current article, then behave just Xas if typed to the \*(L"What next?\*(R" prompt at the end of the article. XSee the documentation at the article selection level for these commands. X.Sp X # $ & / = ? c C f F k K T ^K J , m M r R ^R u U v Y ^ X.br X p P ^P - < > [ ] { } number X.br X range{,range} command{:command} X.Sp XThe following commands also skip to the end of the article, but have the Xadditional effect of marking the current article as read: X.Sp X n N ^N e s S | w W X.Sp X.Sh "Miscellaneous facts about commands" XAn \*(L'n\*(R' typed at either the \*(L"Last newsgroup\*(R" prompt or a X\*(L"Last article\*(R" prompt will cycle back to the top of the newsgroup Xor article list, whereas a \*(L'q\*(R' will quit the level. X(Note that \*(L'n\*(R' does not mean \*(L"no\*(R", but rather X\*(L"next\*(R".) XA space will of course do whatever is shown as the Xdefault, which will vary depending on whether X.I trn Xthinks you have more articles or newsgroups to read. X.PP XThe \*(L'b\*(R' (backup page) command may be repeated until the beginning of Xthe article is reached. XIf X.I trn Xis suspended (via a ^Z), then when the job is resumed, a refresh (^L) will Xautomatically be done (Berkeley-type systems only). XIf you type a command such as \*(L'!\*(R' or \*(L's\*(R' which takes you Xfrom the middle of the article to the end, you can always get back into the Xmiddle by typing \*(L'^L\*(R'. X.PP XIn multi-character commands such as \*(L'!\*(R', \*(L's\*(R', \*(L'/\*(R', Xetc, you can interpolate various run-time values by typing escape and a Xcharacter. XTo find out what you can interpolate, type escape and \*(L'h\*(R', or check Xout the single character % substitutions for environment variables in the XInterpretation and Interpolation section, which are the same. XAdditionally, typing a double escape will cause any % substitutions in the Xstring already typed in to be expanded. X.Sh "The Tree Display" XWhen reading a threaded newsgroup, X.I trn Xdisplays a character representation of the article tree in the upper right Xcorner of the header. XFor example, consider the following display: X.Sp X.nf X (1)+-(1)--(\fI2\fP)--\fI[2]\fP X |-(1)+-[3] X | \\-[1] X \\-(1)+-[1]--[1] X \\-[1] X.fi X.Sp XThis tree represents an initial article that has three direct replies X(the second column with three (1)'s). XEach reply has further replies branching off from them. XIn two cases the subject line was altered in the reply, as indicated Xby the increasing numbers. XWhen there is only one subject associated with a thread, all the nodes Xare marked with the number 1. XWhen the first subject change arrives, it is marked with the number 2, Xand so on. XIf you were to look at this thread in the thread selector, the three Xsubjects associated with it would be listed in the same order as the Xascending digits. XIn those rare cases where more than 9 subjects are associated with each Xthread, the nodes are marked with the letters A-Z, and then by a-z. XThe articles that have already been read are enclosed in ()'s. XUnread articles are displayed in []'s. XThe currently displayed article has its entire node highlighted in the Xdisplay. XThe previously displayed article has only its number highlighted. X.Sh "Options" X.I Trn Xhas a nice set of options to allow you to tailor the interaction Xto your liking. X(You might like to know that the author swears by X\*(L"\-x6ls \-e \+m \-S -XX -N\*(R".) XThese options may be set on the command line, via the RNINIT Xenvironment variable, via a file pointed to by the RNINIT variable, or Xfrom within X.I trn Xvia the & command. XOptions may generally be unset by typing \*(L"+switch\*(R". XOptions include: X.TP 5 X.B \-a Xturns on the alpha-numeric mode of the thread-selector. XThis option has no affect unless X.B \-x Xis also specified (or is the default on your system). X.TP 5 X.B \-c Xchecks for news without reading news. XIf a list of newsgroups is given on the command line, only those newsgroups Xwill be checked; otherwise all subscribed-to newsgroups are checked. XWhenever the X.B \-c Xswitch is specified, a non-zero exit status from X.I trn Xmeans that there is unread news in one of the checked newsgroups. XThe X.B \-c Xswitch does not disable the printing of newsgroups with unread news; Xthis is controlled by the X.B \-s Xswitch. X(The X.B \-c Xswitch is not meaningful when given via the & command.) X.TP 5 X.B \-C Xtells X.I trn Xhow often to checkpoint the X.IR .newsrc , Xin articles read. XActually, this number says when to start thinking about doing a checkpoint Xif the situation is right. XIf a reasonable checkpointing situation doesn't arise within 10 more Xarticles, the X.I .newsrc Xis checkpointed willy-nilly. X.TP 5 X.B \-d Xsets the default save directory to something other than ~/News. XThe directory name will be globbed (via csh) if necessary (and if possible). XArticles saved by X.I trn Xmay be placed in the save directory or in a subdirectory thereof depending Xon the command that you give and the state of the environment variables XSAVEDIR and SAVENAME. XAny KILL files (see the K command in the Article Selection section) Xalso reside in this directory and its subdirectories, by default. XIn addition, shell escapes leave you in this directory. X.TP 5 X.B \-D Xenables debugging output. XSee common.h for flag values. XWarning: normally X.I trn Xattempts to restore your X.I .newsrc Xwhen an unexpected signal or internal error occurs. XThis is disabled when any debugging flags are set. X.TP 5 X.B \-e Xcauses each page within an article to be started at the top of the screen, Xnot just the first page. X(It is similar to the X.B \-c Xswitch of X.IR more (1).) XYou never have to read scrolling text with this switch. XThis is helpful especially at certain baud rates because you can start reading Xthe top of the next page without waiting for the whole page to be printed. XIt works nicely in conjuction with the X.B \-m Xswitch, especially if you use half-intensity for your highlight mode. XSee also the X.B \-L Xswitch. X.TP 5 X.B \-E= Xsets the environment variable to the value specified. XWithin X.IR trn , X\*(L"&\-ESAVENAME=%t\*(R" is similar to \*(L"setenv SAVENAME '%t'\*(R" in X.IR csh , Xor \*(L"SAVENAME='%t'; export SAVENAME\*(R" in X.IR sh . XAny environment variables set with X.B \-E Xwill be inherited by subprocesses of X.IR trn . X.TP 5 X.B \-F Xsets the prefix string for the \*(L'F\*(R' followup command to use in Xprefixing each line of the quoted article. XFor example, \*(L"\-F\*(R" inserts a tab on the front of each line X(which will cause long lines to wrap around, unfortunately), X\*(L"\-F>>>>\*(R" inserts \*(L">>>>\*(R" on every line, and X\*(L"\-F\*(R" by itself causes nothing to be inserted, in case you want to Xreformat the text, for instance. XThe initial default prefix is \*(L">\*(R". X.TP 5 X.B \-g Xtells X.I trn Xwhich line of the screen you want searched-for strings to show up on when Xyou search with the \*(L'g\*(R' command within an article. XThe lines are numbered starting with 1. XThe initial default is \*(L"\-g1\*(R", meaning the first line of the screen. XSetting the line to less than 1 or more than the number of lines on the screen Xwill set it to the last line of the screen. X.TP 5 X.B \-h Xhides (disables the printing of) all header lines beginning with X.I string. XFor instance, \-hexp will disable the printing of the \*(L"Expires:\*(R" line. XCase is insignificant. XIf is null, all header lines except Subject are hidden, and you Xmay then use X.B +h Xto select those lines you want to see. XYou may wish to use the baud-rate switch modifier below to hide more lines Xat lower baud rates. X.TP 5 X.B \-H Xworks just like X.B \-h Xexcept that instead of setting the hiding flag for a header line, it sets Xthe magic flag for that header line. XCertain header lines have magic behavior that can be controlled this way. XAt present, the following actions are caused by the flag for the particular Xline: Xthe Newsgroups line will only print when there are multiple newsgroups; Xthe Subject line will be underlined and (when threaded) the Xkeyword \*(L'Subject:\*(R' is replaced by its subject number (e.g. [1]); Xthe Expires line will always be suppressed if there is nothing on it; Xthe name line is shortened to just the comment portion (the part Xwithin parenthesis) if available; the date line is displayed in local Xtime if the group is threaded. XIn fact, all of these actions are the default, and you must use X.B +H Xto undo them. X.TP 5 X.B \-i= Xspecifies how long (in lines) to consider the initial page of an Xarticle\*(--normally this is determined automatically depending on baud rate. X(Note that an entire article header will always be printed regardless of the Xspecified initial page length. XIf you are working at low baud rate and wish to reduce the size of the Xheaders, you may hide certain header lines with the X.B \(bsh Xswitch.) X.TP 5 X.B \-l Xdisables the clearing of the screen at the beginning of each Xarticle, in case you have a bizarre terminal. X.TP 5 X.B \-L Xtells X.I trn Xto leave information on the screen as long as possible by not blanking Xthe screen between pages, and by using clear to end-of-line. X(The X.IR more (1) Xprogram does this.) XThis feature works only if you have the requisite termcap Xcapabilities. XThe switch has no effect unless the X.B \-e Xswitch is set. X.TP 5 X.B \-m= Xenables the marking of the last line of the previous page Xprinted, to help the user see where to continue reading. XThis is most helpful when less than a full page is going to be displayed. XIt may also be used in conjunction with the X.B \-e Xswitch, in which case the page is erased, and the first line (which is Xthe last line of the previous page) is highlighted. XIf X.B \-m=s Xis specified, the standout mode will be used, but if X.B \-m=u Xis specified, underlining will be used. XIf neither X.B =s Xor X.B =u Xis specified, standout is the default. XUse X.B +m Xto disable highlighting. X.TP 5 X.B \-M Xforces mailbox format in creating new save files. XOrdinarily you are asked which format you want. X.TP 5 X.B \-N Xforces normal (non-mailbox) format in creating new save files. XOrdinarily you are asked which format you want. X.TP 5 X.B \-q Xbypasses the automatic check for new newsgroups when starting X.I trn. X.TP 5 X.B \-r Xcauses X.I trn Xto restart in the last newsgroup read during a previous session with X.I trn. XIt is equivalent to starting up normally and then getting to the newsgroup Xwith a g command. X.TP 5 X.B \-s Xwith no argument suppresses the initial listing of newsgroups with unread Xnews, whether X.B \-c Xis specified or not. XThus X.B \-c Xand X.B \-s Xcan be used together to test \*(L"silently\*(R" the status of news from Xwithin your X.I .login Xfile. XIf X.B \-s Xis followed by a number, the initial listing is suppressed after that many Xlines have been listed. XPresuming that you have your X.I .newsrc Xsorted into order of interest, X.B \-s5 Xwill tell you the 5 most interesting newsgroups that have unread news. XThis is also a nice feature to use in your X.I .login Xfile, since it not only tells you whether there is unread news, but also how Ximportant the unread news is, without having to wade through the entire Xlist of unread newsgroups. XIf no X.B \-s Xswitch is given X.B \-s5 Xis assumed, so just putting \*(L"rn \-c\*(R" Xinto your X\&.login file is fine. X.TP 5 X.B \-S Xcauses X.I trn Xto enter subject search mode (^N) automatically whenever an unthreaded Xnewsgroup is Xstarted up with unread articles or more. XAdditionally, it causes any \*(L'n\*(R' typed while in subject search mode Xto be interpreted as \*(L'^N\*(R' instead. X(To get back out of subject search mode, the best command is probably X\&\*(L'^\*(R'.) XIf is omitted, 3 is assumed. X.TP 5 X.B \-t Xputs X.I trn Xinto terse mode. XThis is more cryptic but useful for low baud rates. X(Note that your system administrator may have compiled X.I trn Xwith either verbose or terse messages only to save memory.) XYou may wish to use the baud-rate switch modifier below to enable terse mode Xonly at lower baud rates. X.TP 5 X.B \-T Xallows you to type ahead of rn. XOrdinarily rn will eat typeahead to prevent your autorepeating space bar from Xdoing a very frustrating thing when you accidentally hold it down. XIf you don't have a repeating space bar, or you are working at low baud Xrate, you can set this switch to prevent this behavior. XYou may wish to use the baud-rate switch modifier below to disable typeahead Xonly at lower baud rates. X.TP 5 X.B \-v Xsets verification mode for commands. XWhen set, the command being executed is displayed to give some feedback that Xthe key has actually been typed. XUseful when the system is heavily loaded and you give a command that takes Xa while to start up. X.TP 5 X.B \-x XEnable the extended (threaded) features of X.I trn Xbeyond the traditional X.I rn Xcompatibility mode. X(This may be the default on your system, use +x if you yearn for the good Xol' days.) XThe is the maximum number of article-tree lines (from 0 to 11) Xyou want displayed in your header. XUse the to choose which thread selector modes you like (s \- short, Xm \- medium, or l \- long), and in what order they are selected with the X\&\*(L'L\*(R' command. XFor example, use X.B \-xls Xto start with the long display mode and only switch between it and Xthe short mode. XYou can omit either or both of the parameters, in which case a default of X.B \-x6lsm Xis assumed. X.TP 5 X.B \-X XIf you like using the thread selector, you'll probably want to use this Xoption to make the thread selector command (+) the default when a newsgroup Xis started up with at least unread articles. X(Your installer may have chosen to make -X1 the default on your system.) XIt is also used to select which commands you want to be the defaults while Xusing the thread selector. XFor example, X.B \-X2XD Xwill make the thread selector the default command for entering a newsgroup Xwith at least 2 unread articles, and set the default command for the LAST Xpage of the thread selector to be the X.B X Xcommand and the default command for all other pages to be the X.B D Xcommand. XEither or both parameters can be omitted, as well as the second default Xcommand (e.g. X.B \-XX Xwould change the default newsgroup entry to use the selector and the default Xcommand for the last page of the selector to be \*(L'X\*(R'). XThe default is X.B \-X1Z> Xif just X.B \-X Xis specified. XTo set the default selector commands without affecting the default entry Xinto a newsgroup, specify a high number, like 9999. X.TP 5 X.B \-/ Xsets SAVEDIR to \*(L"%p/%c\*(R" and SAVENAME to \*(L"%a\*(R", which means Xthat by default articles are saved in a subdirectory of your private news Xdirectory corresponding to the name of the the current newsgroup, with the Xfilename being the article number. X.B +/ Xsets SAVEDIR to \*(L"%p\*(R" and SAVENAME to \*(L"%^C\*(R", which by Xdefault saves articles directly to your private news directory, with the Xfilename being the name of the current newsgroup, first letter capitalized. X(Either X.B +/ Xor X.B \-/ Xmay be default on your system, depending on the feelings of your news Xadministrator when he, she or it installed X.IR trn .) XYou may, of course, explicitly set SAVEDIR and SAVENAME to other values\*(--see Xdiscussion in the environment section. X.PP XAny switch may be selectively applied according to the current baud-rate. XSimply prefix the switch with +speed to apply the switch at that speed or Xgreater, and \%\-speed to apply the switch at that speed or less. XExamples: \%\-1200\-hposted suppresses the Posted line at 1200 baud or less; X\%+9600\-m enables marking at 9600 baud or more. XYou can apply the modifier recursively to itself also: \%+300\-1200\-t sets Xterse mode from 300 to 1200 baud. X.PP XSimilarly, switches may be selected based on terminal type: X.Sp X \-=vt100+T set +T on vt100 X.br X \-=tvi920\-ETERM=mytvi get a special termcap entry X.br X \-=tvi920\-ERNMACRO=%./.rnmac.tvi X.br X set up special keymappings X.br X +=paper\-v set verify mode if not hardcopy X.PP XSome switch arguments, such as environment variable values, may require Xspaces in them. XSuch spaces should be quoted via ", ', or \e in the conventional fashion, Xeven when passed via RNINIT or the & command. X.Sh "Regular Expressions" XThe patterns used in article searching are regular expressions such as Xthose used by X.IR ed (1). XIn addition, \ew matches an alphanumeric character and \eW a nonalphanumeric. XWord boundaries may be matched by \eb, and non-boundaries by \eB. XThe bracketing construct \e(\ ...\ \e) may also be used, and \edigit matches Xthe digit'th substring, where digit can range from 1 to 9. X\e0 matches whatever the last bracket match matched. XUp to 10 alternatives may given in a pattern, separated by \e|, with the Xcaveat that \e(\ ...\ \e|\ ...\ \e) is illegal. X.Sh "Interpretation and Interpolation" XMany of the strings that X.I trn Xhandles are subject to interpretations of several types. XUnder filename expansion, an initial \*(L"~/\*(R" is translated to the name Xof your home directory, and \*(L"~name\*(R" is translated to the login Xdirectory for the user specified. XFilename expansion will also expand an initial environment variable, and Xalso does the backslash, uparrow and percent expansion mentioned below. X.PP XAll interpreted strings go through backslash, uparrow and percent Xinterpretation. XThe backslash escapes are the normal ones (such as \en, \et, \ennn, etc.). XThe uparrow escapes indicate control codes in the normal fashion. XBackslashes or uparrows to be passed through should be escaped with backslash. XThe special percent escapes are similar to printf percent escapes. XThese cause the substitution of various run-time values into the string. XThe following are currently recognized: X.Ip %a 8 XCurrent article number. X.Ip %A 8 XFull name of current article (%P/%c/%a). X(On a Eunice system with the LINKART option, %P/%c/%a returns the name of Xthe article in the current newsgroup, while %A returns the real name of Xthe article, which may be different if the current article was posted to Xmultiple newsgroups.) X.Ip %b 8 XDestination of last save command, often a mailbox. X.Ip %B 8 XThe byte offset to the beginning of the part of the article to be saved, Xset by the save command. XThe \*(L's\*(R' and \*(L'S\*(R' commands set it to 0, and the \*(L'w\*(R' Xand \*(L'W\*(R' commands set it to the byte offset of the body of the article. X.Ip %c 8 XCurrent newsgroup, directory form. X.Ip %C 8 XCurrent newsgroup, dot form. X.Ip %d 8 XFull name of newsgroup directory (%P/%c). X.Ip %D 8 X\*(L"Distribution:\*(R" line from the current article. X.Ip %e 8 XThe last command executed to extract data from an article. X.Ip %E 8 XThe number of extra (unselected) articles, not counting the current article Xif it is unselected. X.Ip %f 8 X\*(L"From:\*(R" line from the current article, or the \*(L"Reply-To:\*(R" Xline if there is one. XThis differs from %t in that comments (such as the full name) are not Xstripped out with %f. X.Ip %F 8 X\*(L"Newsgroups:\*(R" line for a new article, constructed from X\*(L"Newsgroups:\*(R" and \*(L"Followup-To:\*(R" lines of current article. X.Ip %h 8 XName of the header file to pass to the mail or news poster, Xcontaining all the information that the poster program needs in the Xform of a message header. XIt may also contain a copy of the current article. XThe format of the header file is controlled by the MAILHEADER and NEWSHEADER Xenvironment variables. X.Ip %H 8 XHost name (your machine's name). X.Ip %i 8 X\*(L"Message-I.D.:\*(R" line from the current article, with <> guaranteed. X.Ip %I 8 XThe reference indication mark (see the X.B \-F Xswitch.) X.Ip %l 8 XThe news administrator's login name, if any. X.Ip %L 8 XLogin name (yours). X.Ip %m 8 XThe current mode of X.I trn, Xfor use in conditional macros. X.Sp X.nf X i Initializing. X n Newsgroup selection level. X t Thread selection level. X a Article selection level (What next?). X p Pager level (MORE prompt). X u Set unread? prompt. X A Add this newsgroup? X C Catchup confirmation. X D Delete bogus newsgroups? X M Use mailbox format? X R Resubscribe to this newsgroup? X.fi X.Sp XNote that yes/no questions are all upper-case modes. XIf, for example, you wanted to disallow defaults on all yes/no questions, Xyou could define the following macro: X.Sp X.nf X\e040 %(%m=[A-Z]?h: ) X.fi X.Ip %M 8 XThe number of articles marked to return via the \*(L'M\*(R' command. XIf the same article is Marked multiple times, \*(L"%M\*(R" counts it Xmultiple times in the current implementation. X.Ip %n 8 X\*(L"Newsgroups:\*(R" line from the current article. X.Ip %N 8 XFull name (yours). X.Ip %o 8 XOrganization (yours). X.Ip %O 8 XOriginal working directory (where you ran rn from). X.Ip %p 8 XYour private news directory, normally ~/News. X.Ip %P 8 XPublic news spool directory, normally /usr/spool/news on systems that don't use NNTP. X.Ip %r 8 XLast reference on references line of current article (parent article id). X.Ip %R 8 XReferences list for a new article, constructed from the references and article XID of the current article. X.Ip %s 8 XSubject, with all Re's and (nf)'s stripped off. X.Ip %S 8 XSubject, with one \*(L"Re:\*(R" stripped off. X.Ip %t 8 X\*(L"To:\*(R" line derived from the \*(L"From:\*(R" and \*(L"Reply-To:\*(R" Xlines of the current article. XThis always returns an Internet format address. X.Ip %T 8 X\*(L"To:\*(R" line derived from the \*(L"Path:\*(R" line of the Xcurrent article to produce a uucp path. X.Ip %u 8 XThe number of unread articles in the current newsgroup. X.Ip %U 8 XThe number of unread articles in the current newsgroup, not counting the Xthe current article. XWhen threads are selected, this count reflects only selected articles. X.Ip %x 8 XThe news library directory. X.Ip %X 8 XThe rn library directory. X.Ip %z 8 XThe length of the current article in bytes. X.Ip %Z 8 XThe number of selected threads. X.Ip %~ 8 XYour home directory. X.Ip %. 8 XThe directory containing your dot files, which is your home directory unless Xthe environment variable DOTDIR is defined when rn is invoked. X.Ip %# 8 XA counter incremented during multiple-article commands. XPrior to executing any such commands, it will return 0. XDuring a multi-article command, it returns the current count starting from 1. XAfterward, it retains its final value. XFor example, the command X.Sp X 1003-1008 s my.%# X.Sp Xwould save articles 1003 through 1008 in the files my.1 through my.6. X.Ip %$ 8 XCurrent process number. X.Ip %/ 8 XLast search string. X.Ip %% 8 XA percent sign. X.Ip "%{name} or %{name\-default}" 8 XThe environment variable \*(L"name\*(R". X.Ip %[name] 8 XThe value of header line \*(L"Name:\*(R" from the current article. XThe \*(L"Name:\ \*(R" is not included. XFor example \*(L"%D\*(R" and \*(L"%[distribution]\*(R" are equivalent. XThe name must be spelled out in full. X.Ip %`command` 8 XInserts the output of the command, with any embedded newlines translated Xto space. X.Ip %""prompt"" 8 XPrints prompt on the terminal, then inputs one string, and inserts it. X.Ip "%(test_text=pattern?then_text:else_text)" 8 XIf X.I test_text Xmatches X.IR pattern , Xhas the value X.IR then_text , Xotherwise X.IR else_text . XThe \*(L":else_text\*(R" is optional, and if absent, interpolates the null string. XThe = may be replaced with != to negate the test. XTo quote any of the metacharacters X(\*(L'=\*(R', \*(L'?\*(R', \*(L':\*(R', or \*(L')\*(R'), Xprecede with a backslash. X.Ip %digit 8 XThe digits 1 through 9 interpolate the string matched by the nth bracket Xin the last pattern match that had brackets. XIf the last pattern had alternatives, you may not know the number of the Xbracket you want\*(--%0 will give you the last bracket matched. X.PP XModifiers: to capitalize the first letter, insert \*(L'^\*(R': X\*(L"%^C\*(R" produces something like \*(L"Net.jokes\*(R". XInserting \*(L'_\*(R' causes the first letter following the last X\&\*(L'/\*(R' to be capitalized: \*(L"%_c\*(R" produces \*(L"net/Jokes\*(R". X.SH ENVIRONMENT XThe following environment variables are paid attention to by X.IR trn . XIn general the default values assumed for these variables by X.I trn Xare reasonable, so if you are using X.I trn Xfor the first time, you can safely ignore this section. XNote that the defaults below may not correspond precisely to the defaults Xon your system. XTo find the actual defaults you would need to look in config.h and common.h Xin the trn source directory, and the file INIT in the trn library. X.PP XThose variables marked (%) are subject to % interpolation, and those marked X(~) are subject to both % interpolation and ~ interpretation. X.Ip "ATTRIBUTION (%)" 8 XGives the format of the attribution line in front of the quoted article Xincluded by an F command. X.Sp XDefault: In article %i %f writes: X.Ip "CANCEL (~)" 8 XThe shell command used to cancel an article. X.Sp XDefault: inews \-h < %h X.Ip "CANCELHEADER (%)" 8 13v XThe format of the file to pass to the CANCEL command in order to cancel Xan article. X.Sp XDefault: X.br XNewsgroups: %n X.br XSubject: cmsg cancel %i X.br XReferences: %R X.br XReply-To: %L@%H (%N) X.br XDistribution: %D X.br XOrganization: %o X.sp 1 X%i cancelled from rn. X.Ip DOTDIR 8 XWhere to find your dot files, if they aren't in your home directory. XCan be interpolated using \*(L"%.\*(R". X.Sp XDefault: $HOME X.Ip "EDITOR (~)" 8 XThe name of your editor, if VISUAL is undefined. X.Sp XDefault: whatever your news administrator compiled in, usually vi. X.Ip "EXSAVER (%)" 8 XThe shell command to execute in order to extract data to either /bin/sh Xor a user-specified command. X.Sp XDefault: tail +%Bc %A | %e X.Ip "FIRSTLINE (%)" 8 XControls the format of the line displayed at the top of an article. XWarning: this may go away. X.Sp XThe default in an unthreaded group is approximately: X.Sp XArticle %a %(%U%M!=^00$?(%U more%(%M!=^0$? + %M Marked to return)\e) )in %C: X.Sp XWhile the default in a threaded group is almost: X.Sp X%C #%a%(%Z=^0$?%(%U!=^0$? (%U more\e)): (%U + %E more\e)) X.Ip HIDELINE 8 XIf defined, contains a regular expression which matches article lines to Xbe hidden, in order, for instance, to suppress quoted material. XA recommended string for this purpose is \*(L"^>...\*(R", which \fIdoesn't\fR Xhide lines with only \*(L'>\*(R', to give some indication that quoted Xmaterial is being skipped. XIf you want to hide more than one pattern, you can use \*(L"\||\|\*(R" to Xseparate the alternatives. XYou can view the hidden lines by restarting the article with the \*(L'v\*(R' Xcommand. X.Sp XThere is some overhead involved in matching each line of the article against Xa regular expression. XYou might wish to use a baud-rate modifier to enable this feature only at Xlow baud rates. X.Sp XDefault: undefined X.Ip HOME 8 XYour home directory. XAffects ~ interpretation, and the location of your Xdot files if DOTDIR is not defined. X.Sp XDefault: $LOGDIR X.Ip "KILLGLOBAL (~)" 8 XWhere to find the KILL file to apply to every newsgroup. XSee the \*(L'^K\*(R' command at the newsgroup selection level. X.Sp XDefault: %p/KILL X.Ip "KILLLOCAL (~)" 8 XWhere to find the KILL file for the current newsgroup. XSee the commands \*(L'K\*(R' and \*(L'^K\*(R' at the article selection level, Xand the search modifier \*(L'K\*(R'. X.Sp XDefault: %p/%c/KILL X.Ip LOGDIR 8 XYour home directory if HOME is undefined. XAffects ~ interpretation, and the location of your Xdot files if DOTDIR is not defined. X.Sp XDefault: none. X.Sp XExplanation: you must have either $HOME or $LOGDIR. X.Ip LOGNAME 8 XYour login name, if USER is undefined. XMay be interpolated using \*(L"%L\*(R". X.Sp XDefault: value of getlogin(). X.Ip "MAILCALL (~)" 8 XWhat to say when there is new mail. X.Sp XDefault: (Mail) X.Ip "MAILFILE (~)" 8 XWhere to check for mail. X.Sp XDefault: /usr/spool/mail/%L X.Ip "MAILHEADER (%)" 8 XThe format of the header file for replies. XSee also MAILPOSTER. X.Sp XDefault: X.Sp XTo: %T X.br XSubject: %(%i=^$?:Re: %S X.br XNewsgroups: %n X.br XIn-Reply-To: %i) X.br X%(%[references]!=^$?References\\: %[references] X.br X)Organization: %o X.br XCc: X.br XBcc: \en\en X.Ip "MAILPOSTER (~)" 8 XThe shell command to be used by the reply commands (r and R) Xin order to allow you to enter and deliver the response. X.I trn Xwill not itself call upon an editor for replies\*(--this Xis a function of the program called by X.IR trn . XSee also MAILHEADER. X.Sp XDefault: Rnmail \-h %h X.Ip "MBOXSAVER (~)" 8 XThe shell command to save an article in mailbox format. X.Sp XDefault: %X/mbox.saver %A %P %c %a %B %C "%b" \e X.br X"From: %T %`date`" X.Sp XExplanation: the first seven arguments are the same as for NORMSAVER. XThe eighth argument to the shell script is the new From: line Xfor the article, including the posting date, Xderived either directly from the Posted: line, or not-so-directly from Xthe Date: line. XHeader munging at its finest. X.Ip MODSTRING 8 XThe string to insert in the group summary line, which heads each article, Xfor a moderated group. See also NOPOSTRING. X.Sp XDefault: " (moderated)" X.Ip NAME 8 XYour full name. XMay be interpolated using \*(L"%N\*(R". X.Sp XDefault: name from /etc/passwd, or ~/.fullname. X.Ip "NEWSHEADER (%)" 8 16v XThe format of the header file for followups. XSee also NEWSPOSTER. X.Sp XDefault: X.Sp XNewsgroups: %(%F=^$?%C:%F) X.br XSubject: %(%S=^$?%"\en\enSubject: ":Re: %S) X.br XSummary: X.br XExpires: X.br X%(%R=^$?:References: %R X.br X)Sender: X.br XReply-To: %L@%H (%N) X.br XFollowup-To: X.br XDistribution: %(%i=^$?%"\enDistribution: ":%D) X.br XOrganization: %o X.br XKeywords: \en\en X.Ip "NEWSPOSTER (~)" 8 XThe shell command to be used by the followup commands (f and F) Xin order to allow you to enter and post a followup news article. X.I trn Xwill not itself call upon an editor for followups\*(--this Xis a function of the program called by X.IR trn . XSee also NEWSHEADER. X.Sp XDefault: Pnews \-h %h X.Ip NEWSRC 8 XYour newsgroup subscription list. X.Sp XDefault: $HOME/.newsrc X.Ip NNTPSERVER 8 XThe hostname of your NNTPSERVER. [This does not apply unless you are running Xthe NNTP version of rn.] X.Sp XDefault: the hostname listed in the server file, usually X/usr/local/lib/rn/server. X.Ip NOPOSTRING 8 XThe string to insert in the group summary line, which heads each article, Xfor a group to which local posting is not allowed. See also MODSTRING. X.Sp XDefault: " (no posting)" X.Ip "NORMSAVER (~)" 8 XThe shell command to save an article in the normal (non-mailbox) format. X.Sp XDefault: %X/norm.saver %A %P %c %a %B %C "%b" X.Ip ORGANIZATION 8 XEither the name of your organization, or the name of a file containing the Xname of your organization. XMay be interpolated using \*(L"%o\*(R". X.Sp XDefault: whatever your news administrator compiled in. X.Ip PAGESTOP 8 XIf defined, contains a regular expression which matches article lines to Xbe treated as form-feeds. XThere are at least two things you might want to do with this. XTo cause page breaks between articles in a digest, you might define it Xas \*(L"^--------\*(R". XTo force a page break before a signature, you could define it Xas \*(L"^-- $\*(R". X(Then, when you see \*(L"--\*(R" at the bottom of the page, you can skip Xthe signature if you so desire by typing \*(L'n\*(R' instead of space.) XTo do both, you could use \*(L"^--\*(R". XIf you want to break on more than one pattern, you can use \*(L"\||\|\*(R" to Xseparate the alternatives. X.Sp XThere is some overhead involved in matching each line of the article against Xa regular expression. XYou might wish to use a baud-rate modifier to enable this feature only at Xlow baud rates. X.Sp XDefault: undefined X.Ip "PIPESAVER (%)" 8 XThe shell command to execute in order to accomplish a save to a pipe X(\*(L"s\ |\ command\*(R" or \*(L"w\ |\ command\*(R"). XThe command typed by the user is substituted in as %b. X.Sp XDefault: %(%B=^0$?<%A:tail +%Bc %A |) %b X.Sp XExplanation: if %B is 0, the command is \*(L"<%A %b\*(R", otherwise Xthe command is \*(L"tail +%Bc %A | %b\*(R". X.Ip RNINIT 8 XDefault values for switches may be passed to X.I trn Xby placing them in RNINIT. XAny switch that is set in RNINIT may be overruled Xon the command line, or via the \*(L'&\*(R' command from within X.IR trn . XBinary-valued switches that are set with \*(L"\-switch\*(R" may be unset Xusing \*(L"+switch\*(R". X.Sp XIf RNINIT begins with a \*(L'/\*(R' it is assumed to be the name of a file Xcontaining switches. XIf you want to set many environment variables but don't want to keep Xthem all in your environment, or if the use of any of these variables Xconflicts with other programs, you can use this feature along with the X.B \-E Xswitch to set the environment variables upon startup. X.Sp XDefault: \*(L" \*(R". X.Ip "RNMACRO (~)" 8 XThe name of the file containing macros and key mappings. XSee the MACROS section. X.Sp XDefault: %./.rnmac X.Ip "SAVEDIR (~)" 8 XThe name of the directory to save to, if the save command does not specify Xa directory name. X.Sp XDefault: X.br X If X.B \-/ Xis set: %p/%c X.br X If X.B +/ Xis set: %p X.Ip "SAVENAME (%)" 8 XThe name of the file to save to, if the save command contains only a Xdirectory name. X.Sp XDefault: X.br X If X.B \-/ Xis set: %a X.br X If X.B +/ Xis set: %^C X.Ip "SELECTCHARS" 8 XThe characters used by the thread selector to select the associated thread Xof discussion. XYou can specify up to 64 visible characters, including upper- and lower-case Xletters, numbers, and many punctuation characters. XSelection characters override command characters in the selector, but are Xnot excluded from macro expansion, so be careful. X.br XDefault: abcdefgijlorstuvwxz1234567890 X that can be typed X.Ip SHELL 8 XThe name of your preferred shell. XIt will be used by the \*(L'!\*(R', \*(L'S\*(R' and \*(L'W\*(R' commands. X.Sp XDefault: whatever your news administrator compiled in. X.Ip "SUBJLINE (%)" 8 XControls the format of the lines displayed by the \*(L'=\*(R' command at Xthe article selection level. X.Sp XDefault: %s X.Ip TERM 8 XDetermines which termcap entry to use, unless TERMCAP contains the entry. X.Ip TERMCAP 8 XHolds either the name of your termcap file, or a termcap entry. X.Sp XDefault: /etc/termcap, normally. X.Ip "UNSHAR (~)" 8 XThe shell command to execute in order to accomplish the unshar'ing of a Xshell archive. X.Sp XDefault: /bin/sh X.Ip USER 8 XYour login name. XMay be interpolated using \*(L"%L\*(R". X.Sp XDefault: $LOGNAME X.Ip "VISUAL (~)" 8 XThe name of your editor. X.Sp XDefault: $EDITOR X.Ip "YOUSAID (%)" 8 XGives the format of the attribution line in front of the quoted article Xincluded by an R command. X.Sp XDefault: In article %i you write: X.SH MACROS XWhen X.I trn Xstarts up, it looks for a file containing macro definitions (see environment Xvariable RNMACRO). XAny sequence of commands may be bound to any sequence of keys, so you Xcould remap your entire keyboard if you desire. XBlank lines or lines beginning with # in the macro file are considered Xcomments; otherwise X.I trn Xlooks for two fields separated by white space. XThe first field gives the sequence of keystrokes that trigger the macro, Xand the second field gives the sequence of commands to execute. XBoth fields are subject to % interpolation, which will also translate Xbackslash and uparrow sequences. X(The keystroke field is interpreted at startup time, but the command field Xis interpreted at macro execution time so that you may refer to % values Xin a macro.) XFor example, if you want to reverse the roles of carriage return and Xspace in X.I trn X.Sp X^J \e040 X.br X^M \e040 X.br X\e040 ^J X.Sp Xwill do just that. XBy default, all characters in the command field are interpreted as the Xcanonical X.I trn Xcharacters, i.e. no macro expansion is done. XOtherwise the above pair of macros would cause an infinite loop. XTo force macro expansion in the command field, enclose the Xmacro call with ^( ... ^) thusly: X.Sp X@s |mysavescript X.br X@w w^(@s^) X.Sp XYou can use the %() conditional construct to construct macros that work Xdifferently under different circumstances. XIn particular, the current mode (%m) of X.I trn Xcould be used to make a command that only works at a particular level. XThis is particularly vital for the thread selector, which uses most of Xthe lower-case letters to select the associated thread of discussion. XFor example, X.Sp Xa %(%m=t?a:s art.hold\en) X.Sp Xwill return the original letter (a) in the thread selector, and the command X\*(L"s art.hold\en\*(R" everywhere else. X.Sp X%(%{TERM}=vt100?^[[O) /^J X.Sp Xwill do the binding only if the terminal type is vt100, Xthough if you have many of these it would be better to have separate Xfiles for each terminal. X.Sp XIf you want to bind a macro to a function key that puts a common garbage character Xafter the sequence (such as the carriage return on the end of Televideo 920 Xfunction sequences), DO NOT put the carriage return Xinto all the sequences or you will waste a CONSIDERABLE amount of internal Xstorage. XInstead of \*(L"^AF^M\*(R", put \*(L"^AF+1\*(R", which indicates to X.I trn Xthat it should gobble up one character after the F. X.SH "WHAT'S NEW?" XHere's a quick run-down of X.IR trn 's Xnew features and commands aimed at the knowledgeable X.I rn Xuser. X.Sp XOne of the biggest improvements is the Thread Selector, which is bound Xto the \*(L'+\*(R' key. XThe selector displays a list of subject threads and (by default) authors Xto allow you to select the topics that interest you by typing their Xassociated letter. XThe thread selector can also be used to browse articles that have already Xbeen read, to selectively re-read discussions (use the \*(L'U\*(R' command). X.Sp XAnother big improvement is the thread-ordered display of articles. XWhile reading each topic, X.I trn Xdisplays each article and its replies in the order of their parent/child Xrelationship. XThis lets you follow the flow of the discussion better, instead of jumping Xaround from idea to idea or even reading a reply before the original article. X.Sp XAlong this same line is the addition of the article-tree display in the Xupper-right corner of the header. XGlancing at the tree gives you a better feel for how the articles you are Xreading relate to each other. X.Sp XThe header has also been modified to hide a few more header-lines by default X(e.g. References), but, as always, you can override these with \-h. XThere is also some new \*(L"magic\*(R" in the header: the From header is Xtrimmed to be just the comment portion (if available), and the Date header Xis displayed in local time (in threaded groups). XOverride these defaults with +H. X.Sp XOnce you begin reading articles, use the regular movement commands (n, N, Xp, P, etc.) as you normally would. XThen, check out the [, ], {, and } commands to move around in the article Xtree a bit more directly. XFor example, the \*(L'[\*(R' command takes you to your parent article, Xeven if it was already read, whichp is very useful for tracking down the Xcited portion of the article in its original context. X.Sp XThere are additional kill commands for the entire thread (J) and the Xcurrent article and all its replies (,). XThe KILL files have been extended to allow killing by thread (T), which will Xkill a topic even if people fine-tune the subject along the way. X.Sp XThere is also an easy way to skip around in the various threads with Xthe < and > commands. X.Sp XThere is a new command, \*(L"e dir\*(R", that extracts a shell archive or Xuuencoded file into the specified directory. XIt is even possible to extract other data formats if you specify the Xappropriate filter command (e.g. \*(L"e dir|cmd\*(R". X.Sp XAlso, if you plan to use macro definitions, it is good to keep in mind Xthat the thread selector uses most of the lower-case letters for thread Xselection, and thus it is a good idea to explicitly set the mode(s) in Xwhich a macro applies. XFor example, if you want to press 'f' from the article pager/selector to Xforward the current article to the user \*(L"smith\*(R", you could define: X.Sp X.nf X f %(%m=[pa]?|mail smith\en:f) X.fi X.Sp XThis checks the current mode (%m) and if it is \*(L'p\*(R' or \*(L'a\*(R' Xit expands it to the string \*(L"|mail smith\en\*(R", otherwise it returns Xthe letter \*(L'f\*(R'. XIn some cases, you may simply wish to exclude the thread selector from a Xmacro with the conditional \*(L"%m!=t\*(R". X.Sp XFinally, you'll probably want to use the new options, X.B \-x Xand X.B \-X Xto ensure that all the newest features are available for use. XThese options might be on by default, depending on how your administrator Xdecided to install X.IR trn . X.SH AUTHORS XRn was created by Larry Wall X.br Xand is now under the direction of Stan Barber . X.br XThreaded version by Wayne Davison X.br X(Mail all bug reports for trn to Wayne.) X.br XRegular expression routines are borrowed from emacs, by James Gosling. X.SH FILES X.Ip "%./.newsrc" 1.25i Xstatus of your news reading X.Ip "%./.oldnewsrc" 1.25i Xbackup copy of your X.I .newsrc Xfrom start of session X.Ip "%./.rnlock" 1.25i Xlock file so you don't screw up your X.I .newsrc X.Ip "%./.rnlast" 1.25i Xinfo from last run of rn X.Ip "%./.rnsoft" 1.25i Xsoft pointers into /usr/lib/news/active to speed startup, synchronous with X.I .newsrc X.Ip "%./.rnhead" 1.25i Xtemporary header file to pass to a mailer or news poster X.Ip "%./.rnmac" 1.25i Xmacro and keymap definitions X.Ip "%p" 1.25i Xyour news save directory, usually ~/News X.Ip "%x/active" 1.25i Xthe list of active newsgroups, usually /usr/lib/news/active on systems that don't use NNTP X.Ip "%X/active2" 1.25i Xthe list of active newsgroups when running in threaded mode. X.Ip "%P" 1.25i Xthe public news spool directory, usually /usr/spool/news on systems that don't use NNTP X.Ip "%X/INIT" 1.25i Xsystem-wide default switches X.SH SEE ALSO Xnewsrc(5), more(1), readnews(1), Pnews(1), Rnmail(1) X.SH DIAGNOSTICS XGenerally self-documenting, as they say. X.SH BUGS XThe X.B \-h Xswitch can only hide header lines that X.I trn Xknows about. X.PP XThe \*(L'\-\*(R' command doesn't cross newsgroup boundaries, and only undoes Xthe last article selection. X.PP XIf you edit your X.I .newsrc Xwhile X.I trn Xis running, X.I trn Xwill happily wipe out your changes when it decides to Xwrite out the X.I .newsrc Xfile. X.PP XMarking of duplicate articles as read in cross-referenced newsgroups will Xnot work unless the Xref patch is installed in inews. X.PP XIf you get carried away with % or escape substitutions, you can overflow Xbuffers. X.PP XThere should be no fixed limit on the number of newsgroups. X.PP XSome of the more esoteric features may be missing on machines with limited Xaddress space. END_OF_FILE if test 42762 -ne `wc -c <'trn.1.2'`; then echo shar: \"'trn.1.2'\" unpacked with wrong size! fi # end of 'trn.1.2' fi echo shar: End of archive 2 \(of 14\). cp /dev/null ark2isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 14 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still must unpack the following archives: echo " " ${MISSING} fi exit 0