[net.news] rn "list subjects of all articles"

faunt@spar.UUCP (Doug Faunt) (05/06/86)

Has anyone done a modification to rn to implement (or does it have it
hidden somewhere), a command that will print subject lines of ALL
available articles, like "=" does for unread articles?
		Thanks,

	...!ihnp4!{hplabs|decwrl}!spar!faunt    faunt@sri-kl.ARPA

grr@cbmvax.cbm.UUCP (George Robbins) (05/07/86)

In article <248@spar.UUCP> faunt@spar.UUCP (Doug Faunt) writes:
>Has anyone done a modification to rn to implement (or does it have it
>hidden somewhere), a command that will print subject lines of ALL
>available articles, like "=" does for unread articles?
>		Thanks,
>	...!ihnp4!{hplabs|decwrl}!spar!faunt    faunt@sri-kl.ARPA

This had been bugging me for quite a while - so here are the context
diffs for a quick and dirty fix that makes ~ act like =, but shows all
the spooled articles...

			George Robbins
			...!{ihnp4|seismo|caip}!cbmvax!grr
			(hiding from Larry Wall for the moment...)


*** rn/art.c	Thu Mar 13 13:47:47 1986
--- rn.play/art.c	Tue May  6 22:47:41 1986
***************
*** 742,747
      case '1': case '2': case '3': case '4': case '5':
      case '6': case '7': case '8': case '9':
      case '=':
      case '?':
      case 'c':	case 'C':	
      case 'f':	case 'F':	

--- 742,748 -----
      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':	
      case 'f':	case 'F':	
*** rn/artsrch.c	Thu Mar 13 13:49:46 1986
--- rn.play/artsrch.c	Tue May  6 23:20:04 1986
***************
*** 181,187
  	kf_append(saltbuf);
      }
  #endif
!     if (cmdlst && index(cmdlst,'='))
  	normal_return = SRCH_ERROR;	/* listing subjects is an error? */
      if (get_cmd) {
  	fputs("\nSearching...\n",stdout) FLUSH;

--- 181,187 -----
  	kf_append(saltbuf);
      }
  #endif
!     if (cmdlst && (index(cmdlst,'=') || index(cmdlst,'~')))
  	normal_return = SRCH_ERROR;	/* listing subjects is an error? */
      if (get_cmd) {
  	fputs("\nSearching...\n",stdout) FLUSH;
*** rn/ng.c	Thu Mar 13 13:47:33 1986
--- rn.play/ng.c	Tue May  6 23:55:07 1986
***************
*** 739,745
  	    printf("\n%ld\n",(long)lastart) FLUSH;
  #endif
  	return AS_ASK;
!     case '=': {
  	char tmpbuf[256];
  	ART_NUM oldart = art;
  	int cmd;

--- 739,746 -----
  	    printf("\n%ld\n",(long)lastart) FLUSH;
  #endif
  	return AS_ASK;
!     case '=':
!     case '~': {
  	char tmpbuf[256];
  	ART_NUM oldart = art;
  	int cmd;
***************
*** 753,759
  	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)) &&

--- 754,760 -----
  	if (!subj_list)
  	    fetchsubj(art,TRUE,FALSE);
  #endif
! 	for (i=(*buf=='~'?absfirst:firstart); i<=lastart && !int_count; i++) {
  #ifdef CACHESUBJ
  	    if ((!was_read(i) || *buf == '~') &&
  	      (subj_list[OFFSET(i)] != Nullch || fetchsubj(i,FALSE,FALSE)) &&
***************
*** 755,761
  #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);

--- 756,762 -----
  #endif
  	for (i=(*buf=='~'?absfirst:firstart); i<=lastart && !int_count; i++) {
  #ifdef CACHESUBJ
! 	    if ((!was_read(i) || *buf == '~') &&
  	      (subj_list[OFFSET(i)] != Nullch || fetchsubj(i,FALSE,FALSE)) &&
  	      *subj_list[OFFSET(i)] ) {
  		sprintf(tmpbuf,"%5ld ", i);
***************
*** 773,779
  		}
  	    }
  #else
! 	    if (!was_read(i) && (s = fetchsubj(i,FALSE,FALSE)) && *s) {
  		sprintf(tmpbuf,"%5ld ", i);
  		if (subjline) {	/* probably fetches it again! */
  		    art = i;

--- 774,781 -----
  		}
  	    }
  #else
! 	    if ((!was_read(i) || *buf == '~') &&
! 	      (s = fetchsubj(i,FALSE,FALSE)) && *s) {
  		sprintf(tmpbuf,"%5ld ", i);
  		if (subjline) {	/* probably fetches it again! */
  		    art = i;
*** rn/ngstuff.c	Thu Mar 13 13:48:01 1986
--- rn.play/ngstuff.c	Tue May  6 23:24:38 1986
***************
*** 248,254
  	    return -1;
  #endif
  	}
! 	else if (ch == '=') {
  	    printf("\t%s",fetchsubj(art,FALSE,FALSE));
  #ifdef VERBOSE
  	    IF(verbose)

--- 248,254 -----
  	    return -1;
  #endif
  	}
! 	else if (ch == '=' || ch == '~') {
  	    printf("\t%s",fetchsubj(art,FALSE,FALSE));
  #ifdef VERBOSE
  	    IF(verbose)
*** rn/rn.c	Thu Mar 13 13:48:43 1986
--- rn.play/rn.c	Tue May  6 23:04:04 1986
***************
*** 437,443
  		    crmode();
  		    goto reask_newsgroup;
  		}
! 		case '.': case '=':
  		case 'y': case 'Y': /* do normal thing */
  		    if (ng >= nextrcline) {
  			fputs("\nNot on a newsgroup.",stdout) FLUSH;

--- 437,443 -----
  		    crmode();
  		    goto reask_newsgroup;
  		}
! 		case '.': case '=': case '~':
  		case 'y': case 'Y': /* do normal thing */
  		    if (ng >= nextrcline) {
  			fputs("\nNot on a newsgroup.",stdout) FLUSH;
***************
*** 445,450
  		    }
  		    if (*buf == '=')
  			s = savestr("=");
  		    else if (*buf == '.') {	/* start command? */
  			if (!finish_command(FALSE)) /* get rest of command */
  			    goto reinp_newsgroup;

--- 445,452 -----
  		    }
  		    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;

-- 
George Robbins - now working with,	uucp: {ihnp4|seismo|caip}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@seismo.css.GOV
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)

ken@turtlevax.UUCP (Ken Turkowski) (05/07/86)

In article <248@spar.UUCP> faunt@spar.UUCP (Doug Faunt) writes:
>Has anyone done a modification to rn to implement (or does it have it
>hidden somewhere), a command that will print subject lines of ALL
>available articles, like "=" does for unread articles?

How about a mod to print the subject lines of all of the unread articles
in all of the newsgroups, putting the results out to the standard
output non-interactively, like "readnews -l"?
-- 
Ken Turkowski @ CIMLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,seismo}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.DEC.COM

andy@cbmvax.cbm.UUCP (Andy Finkel) (05/07/86)

In article <248@spar.UUCP> faunt@spar.UUCP (Doug Faunt) writes:
>Has anyone done a modification to rn to implement (or does it have it
>hidden somewhere), a command that will print subject lines of ALL
>available articles, like "=" does for unread articles?
>		Thanks,
>
>	...!ihnp4!{hplabs|decwrl}!spar!faunt    faunt@sri-kl.ARPA


I've always used the

1-9999=

command for doing that.  

				andy
-- 

			andy finkel
			Commodore(Amiga)
			{ihnp4|seismo|allegra}!cbmvax!andy
		or	 pyramid!amiga!andy


"I disclaim all responsibilities, all shapes, all sizes, all colors."

"Remember, no matter where you grow, there you are." - Buckaroo Bonsai.

markb@sdcrdcf.UUCP (Mark Biggar) (05/07/86)

In article <200@cbmvax.cbmvax.cbm.UUCP> grr@cbmvax.UUCP (George Robbins) writes:
>In article <248@spar.UUCP> faunt@spar.UUCP (Doug Faunt) writes:
>>Has anyone done a modification to rn to implement (or does it have it
>>hidden somewhere), a command that will print subject lines of ALL
>>available articles, like "=" does for unread articles?
>This had been bugging me for quite a while - so here are the context
>diffs for a quick and dirty fix that makes ~ act like =, but shows all
>the spooled articles...

Why go to all the trouble of modifing rn when all you have to do is define
the following macro to your .rnmac file?

~       $/./r:=

which says "go to the end of the newsgroup, then search forward (it wraps)
for each article (including the unread ones) that has a non-null subject
and display it".