Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!caip!cbmvax!grr From: grr@cbmvax.cbm.UUCP (George Robbins) Newsgroups: net.news Subject: Re: rn "list subjects of all articles" Message-ID: <200@cbmvax.cbmvax.cbm.UUCP> Date: Wed, 7-May-86 00:18:42 EDT Article-I.D.: cbmvax.200 Posted: Wed May 7 00:18:42 1986 Date-Received: Thu, 8-May-86 05:51:39 EDT References: <248@spar.UUCP> Reply-To: grr@cbmvax.UUCP (George Robbins) Distribution: net Organization: Commodore Technology, West Chester, PA Lines: 194 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)