chris@umcp-cs.UUCP (06/15/83)
One thing I'd very much like in 2.10's invocation of more is the use of a temp file. More (and page) are much nicer on real files: they tell you how far you are; you can go back, or search forward; you can invoke VI on the file [and more! Hey, this sounds like an advertisement.]. This shouldn't be too hard. - Chris ({seismo,allegra}!umcp-cs!chris)
smk@linus.UUCP (Steven M. Kramer) (06/15/83)
From chris@umcp-cs.UUCP Tue Jun 14 19:53:08 1983 Article-I.D.: umcp-cs.164 Organization: Univ. of Maryland, Computer Science Dept. One thing I'd very much like in 2.10's invocation of more is the use of a temp file. More (and page) are much nicer on real files: they tell you how far you are; you can go back, or search forward; you can invoke VI on the file [and more! Hey, this sounds like an advertisement.]. This shouldn't be too hard. - Chris ({seismo,allegra}!umcp-cs!chris) Why use a temp file? News knows where the file is! I never understood why news was sent as stdin to more when more could be invoked with the news as an argument. An added benefit is that you can then see how much of the file you've read (like you said) AND can use :p to reread the file without having to go through the readnews interface again and reinvoking more. -- --steve kramer {allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!smk (UUCP) linus!smk@mitre-bedford (ARPA)
alb@alice.UUCP (06/16/83)
PAGER is not invoked with the raw article file as is because that file has all the icky header information, and most people don't want to see all that stuff for each article (I certainly don't!).
ee163ht@sdccsu3.UUCP (06/16/83)
Of course, the reason readnews doesn't use the real news file and sends the file through stdin to more (or whatever) is because readnews weeds out all the boring headers. If more just read from the real file, half a page of headers for each article would get pretty boring pretty fast. Also, readnews tells you how long the file is in lines. This can give you a pretty good idea of how long the file is. It might *even* be possible for readnews to print '(10 lines/654 chars) More?'. But it would be nice to be able to just say :p and reread the file without going back through readnews... It seems that creating a temporary file would be too slow, though. Allyn Fratkin UC San Diego
woods@hao.UUCP (06/16/83)
> PAGER is not invoked with the raw article file as is because that > file has all the icky header information, and most people don't want > to see all that stuff for each article (I certainly don't!). Then how about invoking more on the file as "more +n file" where "n" is the number of header lines. Then you only see header lines if you explicitly go back via :p . The only problem with this, I guess, is that not all PAGER's have a +n option. Sigh. GREG {ucbvax!hplabs | allegra!nbires | decvax!brl-bmd | harpo!seismo | menlo70} !hao!woods
uh@zti1.UUCP (06/16/83)
If you want to let readnews read from a file instead of a pipe, set the environment variable PAGER to "more %", e.g. PAGER="/usr/ucb/more %"; export PAGER You may also wish to set the env. variable MORE to MORE=-csu; export MORE Try both and see if you like that better
bj@yale-com.UUCP (06/17/83)
PAGER is not invoked with the raw article file as is because that file has all the icky header information, and most people don't want to see all that stuff for each article (I certainly don't!). more has the option to allow you to start at a specific line number in the file. This does not apply to all possible paging programs, but the use of more is so common that I think it would be worthwhile to make it possible to use this option and get the advantage of those extra features of more. *I* would like it. B.J. Herbison-BJ@Yale decvax!yale-comix!herbison-bj
essick@uiucdcs.UUCP (06/17/83)
#R:umcp-cs:-16400:uiucdcs:10900022:000:1187 uiucdcs!essick Jun 16 12:47:00 1983 On the idea of invoking the PAGER with the actual file instead of just the body so users can take advantage of the pager's features: "More" has the ability to start up the printout at a given line number. Since news has (presumably) figured out how many lines of headers there are, it can tell "more" to skip that many. [As a side note, if the news software knows that the article is a notesfile article - which it can get by reading the first few lines of the article - it can bump the count so that users don't have to see those embarassing notesfile headers I put into the text *sigh*] If people want to reread the article without going through back through news they might have to wade through the headers, but such is life. For people without "more", there are several alternatives, (1) stay with the old way, (2) suffer through the headers, (3) port "more" to your machine, or (4) write a quick and dirty tool that will do the job. If the first three fail, writing such a tool can't be more than 20 minutes work -- have it strip the first few lines and put the remainder somewhere else (/tmp/art.$$) and invoke a stock paging program. -- Ray Essick, University of Illinois
chris@umcp-cs.UUCP (06/17/83)
From: uh@zti1.UUCP If you want to let readnews read from a file instead of a pipe, set the environment variable PAGER to "more %", e.g. PAGER="/usr/ucb/more %"; export PAGER Well, it works, *but*... then it doesn't skip the headers. I think maybe the right solution is to fix more; have it create a temp file when reading from a pipe. - Chris P.S. Another gripe: I can't ``~m'' inside a reply. I have to remember the name of the article and :r it in. Yes, I've heard of the strange UCBMail interface, but we can't find the right place for it; we have a different version of the Mail source. I think I'll switch to Emacs Rnews. -- UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris.umcp-cs@UDel-Relay
jhh@ihldt.UUCP (06/17/83)
Flame on There is nothing worse than allowing selection of a pager by environment variables and then customizing the call of that pager to one and only one pager. The same thing happenned with the mail responses. The first implementation was all tied to UCB through Mail and/or vi. While I have nothing against them, I use Montgomery's EMACS and it's mail interface, which does not support giving an address as an option. News 2.10 has fixed that problem by sending the response to EDITOR, and mailing the result. This allows any editor to be used. If enhancements to an interface are made, make them portable. One method could be to specify options in the PAGER variable. Also, be sure that they are upward compatible with current software. Not everybody has time to make changes over all the source code so that everything works together. There are some places that do not want the PAGER invoked on the real file because the location of those files is not fully known. Flame off. John Haller
laura@utcsstat.UUCP (06/18/83)
You can always write a sed script to remove the nasty header stuff if you want to readnews into a file. Laura Creighton utzoo!utcsstat!laura
solomon@uwvax.UUCP (06/18/83)
Yep, if PAGER is /usr/ucb/more, having it read its input from the news article itself rather than a pipe is a real win. It's even better if you exec() it rather than popen() or system() it, since that's much faster. I hacked it into version 2.9 b news a long time ago and it works just fine. I haven't gotten around to putting it into 2.10 news yet, but it should be just about the same. The changes to news version 2.9 follow. As you can see, it's really quite simple. (Sorry about the long lines. This looks much better if you set tabstops every 4 positions rather than every 8.) Marvin Solomon Computer Sciences Department University of Wisconsin, Madison WI solomon@uwisc ...!seismo!uwvax!solomon *** orig/readr.c Sun Oct 3 09:53:15 1982 --- ./readr.c Fri Apr 22 10:02:47 1983 *** 84,89 FILE *pfp, *popen(); int cnt; pfp = popen(PAGER, "w"); if (pfp == NULL) pfp = ofp; --- 85,121 ----- FILE *pfp, *popen(); int cnt; + /* solomon@uwisc, 10/3/82: + * special hack if PAGER=PAGE (/usr/ucb/more) + * treat it as if it were "PAGE %", but without + * the overhead of forking a shell. + * The advantage of this over using popen() is + * that "more" has a file to work with, so it + * can do good things like tell how much remains. + */ + if (strcmp(PAGER,PAGE)==0) { + char offset[20]; + int pos, nlines, child; + + /* find the current line number in the file */ + pos = ftell(fp); + fseek(fp,0L,0); + nlines = 0; + while (pos--) + if(getc(fp)=='\n') + nlines++; + sprintf(offset,"+%d",nlines); + + if ((child=fork())==0) { + execl(PAGER,PAGER,offset,filename,0); + } + else + (void) fwait(child); + fclose(fp); + fp = NULL; + sigtrap = FALSE; + goto nextart; + } pfp = popen(PAGER, "w"); if (pfp == NULL) pfp = ofp; *************** -- Marvin Solomon Computer Sciences Department University of Wisconsin, Madison WI solomon@uwisc ...!seismo!uwvax!solomon