🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #1247

how to list subjects of read articles in rn?

#1247
From: Joe Ramey
Date: Tue, 25 Feb 1992 19:52
200 lines
7081 bytes
The = command in rn will list the subjects of unread articles in rn.
How can you list the subjects of all articles, including already read
ones?  I tried this macro:

_ %(%m=n?.)1-$=^J

and it works okay, but it doesn't stop after every screenful like the
= command does.  Is there some way to make it do so?  I ended up
hacking this command into the rn source, though I'd rather solve it
with a macro if possible.

Here are context diffs from rn 4.4.3 for my patch to add the _ command
to list subjects of all articles:

diff -c -r rn4.4.3.old/art.c rn4.4.3/art.c
*** rn4.4.3.old/art.c	Tue Feb 25 13:30:59 1992
--- rn4.4.3/art.c	Tue Feb 25 13:22:16 1992
***************
*** 806,811 ****
--- 806,812 ----
      case '/':
      case '1': case '2': case '3': case '4': case '5':
      case '6': case '7': case '8': case '9':
+     case '_':
      case '=':
      case '?':
      case 'c':	case 'C':	
diff -c -r rn4.4.3.old/help.c rn4.4.3/help.c
*** rn4.4.3.old/help.c	Tue Feb 25 13:31:10 1992
--- rn4.4.3/help.c	Tue Feb 25 13:35:05 1992
***************
*** 87,93 ****
  Type h at end of article for a description of these commands:\n\
  ",STANDOUT)) ||
      (cmd = print_lines("\
! 	# $ & / = ? c C f F k K ^K m M number e r R ^R s S u v w W Y ^ |\n\
  \n\
  (To return to the middle of the article after one of these commands, type ^L.)\n\
  ",NOMARKING)) )
--- 87,93 ----
  Type h at end of article for a description of these commands:\n\
  ",STANDOUT)) ||
      (cmd = print_lines("\
! 	# $ & / = _ ? c C f F k K ^K m M number e r R ^R s S u v w W Y ^ |\n\
  \n\
  (To return to the middle of the article after one of these commands, type ^L.)\n\
  ",NOMARKING)) )
***************
*** 180,185 ****
--- 180,186 ----
  K	Mark current subject as read, and save command in KILL file.\n\
  ^K	Edit local KILL file (the one for this newsgroup).\n\
  =	List subjects of unread articles.\n\
+ _	List subjects of all articles.\n\
  ",NOMARKING)) ||
      (cmd = print_lines("\
  u	Unsubscribe from this newsgroup.\n\
***************
*** 211,216 ****
--- 212,218 ----
  ",NOMARKING)) ||
      (cmd = print_lines("\
  =	Start this newsgroup, but list subjects before reading articles.\n\
+ _	Start this newsgroup, but list all subjects before reading articles.\n\
  ",NOMARKING)) ||
      (cmd = print_lines("\
  u	Unsubscribe from this newsgroup.\n\
diff -c -r rn4.4.3.old/ng.c rn4.4.3/ng.c
*** rn4.4.3.old/ng.c	Tue Feb 25 13:31:25 1992
--- rn4.4.3/ng.c	Tue Feb 25 13:24:31 1992
***************
*** 891,899 ****
--- 891,901 ----
  	    printf("\n%ld\n",(long)lastart) FLUSH;
  #endif
  	return AS_ASK;
+     case '_':			/* list all subjects */
      case '=': {			/* list subjects */
  	char tmpbuf[256];
  	ART_NUM oldart = art;
+ 	ART_NUM startart;
  	int cmd;
  	char *subjline = getval("SUBJLINE",Nullch);
  #ifndef CACHESUBJ
***************
*** 905,913 ****
  	if (!subj_list)
  	    fetchsubj(art,TRUE,FALSE);
  #endif
! 	for (i=firstart; i<=lastart && !int_count; i++) {
  #ifdef CACHESUBJ
! 	    if (!was_read(i) &&
  	      (subj_list[OFFSET(i)] != Nullch || fetchsubj(i,FALSE,FALSE)) &&
  	      *subj_list[OFFSET(i)] ) {
  		sprintf(tmpbuf,"%5ld ", i);
--- 907,919 ----
  	if (!subj_list)
  	    fetchsubj(art,TRUE,FALSE);
  #endif
! 	if (*buf == '_')
! 	  startart = absfirst;
! 	else
! 	  startart = firstart;
! 	for (i=startart; i<=lastart && !int_count; i++) {
  #ifdef CACHESUBJ
! 	    if ((*buf == '_' || !was_read(i)) &&
  	      (subj_list[OFFSET(i)] != Nullch || fetchsubj(i,FALSE,FALSE)) &&
  	      *subj_list[OFFSET(i)] ) {
  		sprintf(tmpbuf,"%5ld ", i);
***************
*** 925,931 ****
  		}
  	    }
  #else
! 	    if (!was_read(i) && (s = fetchsubj(i,FALSE,FALSE)) && *s) {
  		sprintf(tmpbuf,"%5ld ", i);
  		if (subjline) {	/* probably fetches it again! */
  		    art = i;
--- 931,938 ----
  		}
  	    }
  #else
! 	    if ((*buf == '_' || !was_read(i)) &&
!               (s = fetchsubj(i,FALSE,FALSE)) && *s) {
  		sprintf(tmpbuf,"%5ld ", i);
  		if (subjline) {	/* probably fetches it again! */
  		    art = i;
diff -c -r rn4.4.3.old/rn.1 rn4.4.3/rn.1
*** rn4.4.3.old/rn.1	Tue Feb 25 13:31:44 1992
--- rn4.4.3/rn.1	Tue Feb 25 13:35:21 1992
***************
*** 176,181 ****
--- 176,183 ----
  The command will be interpreted as if given on the article selection level.
  .Ip = 8
  Do this newsgroup now, but list subjects before displaying articles.
+ .Ip _ 8
+ Do this newsgroup now, but list all subjects before displaying articles.
  .Ip n 8
  Go to the next newsgroup with unread news.
  .Ip N 8
***************
*** 683,688 ****
--- 685,692 ----
  from a range or search command.
  .Ip = 8
  List subjects of unread articles.
+ .Ip _ 8
+ List subjects of all articles.
  .Ip # 8
  Print last article number.
  .Sh "Pager Level"
***************
*** 744,750 ****
  as if typed to the \*(L"What next?\*(R" prompt at the end of the article.
  See the documentation at the article selection level for these commands.
  .Sp	
!     # $ & / = ? c C f F k K ^K m M r R ^R u v Y ^
  .br
      number
  .br
--- 748,754 ----
  as if typed to the \*(L"What next?\*(R" prompt at the end of the article.
  See the documentation at the article selection level for these commands.
  .Sp	
!     # $ & / = _ ? c C f F k K ^K m M r R ^R u v Y ^
  .br
      number
  .br
diff -c -r rn4.4.3.old/rn.c rn4.4.3/rn.c
*** rn4.4.3.old/rn.c	Tue Feb 25 13:31:46 1992
--- rn4.4.3/rn.c	Tue Feb 25 13:23:29 1992
***************
*** 539,545 ****
  		    crmode();
  		    goto reask_newsgroup;
  		}
! 		case '.': case '=':
  		case 'y': case 'Y': /* do normal thing */
  		    if (ng >= nextrcline) {
  			fputs("\nNot on a newsgroup.",stdout) FLUSH;
--- 539,545 ----
  		    crmode();
  		    goto reask_newsgroup;
  		}
!                 case '.': case '=': case '_':
  		case 'y': case 'Y': /* do normal thing */
  		    if (ng >= nextrcline) {
  			fputs("\nNot on a newsgroup.",stdout) FLUSH;
***************
*** 547,552 ****
--- 547,554 ----
  		    }
  		    if (*buf == '=')
  			s = savestr("=");
+ 		    else if (*buf == '_')
+ 		        s = savestr("_");
  		    else if (*buf == '.') {	/* start command? */
  			if (!finish_command(FALSE)) /* get rest of command */
  			    goto reinp_newsgroup;
Technical Details
Message-ID: <RAMEY.92Feb25135308@jello.csc.ti.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!ramey

Show Full Headers
Complete Article Headers
Message-ID: <RAMEY.92Feb25135308@jello.csc.ti.com>
Subject: how to list subjects of read articles in rn?
Date: Tue, 25 Feb 1992 19:52:52 GMT
From: ramey@jello.csc.ti.com (Joe Ramey)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!ramey
Newsgroups: news.software.readers
Originator: ramey@jello
Lines: 201
Sender: usenet@csc.ti.com
Nntp-Posting-Host: jello
Organization: Texas Instruments
Distribution: news