[comp.sources.bugs] reimplemented feature in less

pwolfe@kailand.KAI.COM (09/22/88)

Version 73 of less (-: Why the new version number scheme, Mark?  Trying to
confuse us? :-) had a feature that was eliminated in the recent posting.  The
"e" option still quits the second time you reach end of file, but now if a
single file being displayed that is less than one screen length, less doesn't
exit immediately, but displays it's prompt instead.  I prefered the old
action.

The following patch adds four lines to prim.c to re-implement this feature.
Feed to patch or hand implement if you like.


Patrick J. Wolfe  (pwolfe@kai.com,  uunet!kailand!pwolfe)
System Manager, Kuck and Associates Inc.



*** oldprim.c	Thu Sep 22 07:30:29 1988
--- prim.c	Thu Sep 22 07:29:48 1988
***************
*** 21,26
  extern int linenums;
  extern int plusoption;
  extern char *line;
  extern char *first_cmd;
  #if TAGS
  extern int tagoption;

--- 21,27 -----
  extern int linenums;
  extern int plusoption;
  extern char *line;
+ extern int ac;
  extern char *first_cmd;
  #if TAGS
  extern int tagoption;
***************
*** 198,203
  		eof_bell();
  	else if (do_repaint)
  		repaint();
  	first_time = 0;
  	(void) currline(BOTTOM);
  }

--- 199,207 -----
  		eof_bell();
  	else if (do_repaint)
  		repaint();
+ 	if (first_time && hit_eof && quit_at_eof && ac <= 1) {
+ 		quit ();
+ 		}
  	first_time = 0;
  	(void) currline(BOTTOM);
  }

nagel@paris.ics.uci.edu (Mark Nagel) (09/23/88)

In article <2800001@kailand> pwolfe@kailand.KAI.COM writes:
|
|Version 73 of less (-: Why the new version number scheme, Mark?  Trying to
|confuse us? :-) had a feature that was eliminated in the recent posting.  The
|"e" option still quits the second time you reach end of file, but now if a
|single file being displayed that is less than one screen length, less doesn't
|exit immediately, but displays it's prompt instead.  I prefered the old
|action.

I don't recommend using this patch for the following reason:  When I installed
v73 here and that *feature* was discovered, I was yelled at quite a bit
because it would cause things like man pages looked at from, say, an X
window on a Sun, to immediately disappear taking the window with it.
So, if you use windows and less exiting takes the window with it, you
will want less to always stop with -e, no matter how short the file is.
-- 
Mark Nagel
Department of Information and Computer Science, UC Irvine
nagel@ics.uci.edu             (ARPA)             When they ship styrofoam...
{sdcsvax|ucbvax}!ucivax!nagel (UUCP)             ...what do they pack it in?