[comp.unix.aux] man - please wait!

jim@jagubox.gsfc.nasa.gov (Jim Jagielski) (11/15/90)

Is anyone else upset with the way man works with multi-listing man pages?

For example, "man mount" gives you the printing for all listings of "mount",
but it always scrolls/clear the last page of a section before you have a
chance to read it and then starts up with the 1st page of the next listing.

For example, assume that mount has 3 listings: the 1st has 5 pages, the 2nd
2 and the 3rd 4. When "man mount" is done, it'll show pages 1-4 (pausing
at each screenfull), but then it show page 5, then immediately clear and show
page 1 of listing 2.

This is because more always exits at EOF, instead of waiting for you to
tell it to exit (ala less and pg). Hence, when the last page is shown, more
exits as soon as it "types" it, the eval in man (/usr/bin/man is a shell
script) exits and then the next listing is piped to more which immdiately
clears the screen and shows the next listing.

Changing the filter used by man (either by PAGER or editing /usr/bin/man) is
no help because:

	1) less can't handle the "escape sequences" for bold, etc.

	2) pg don't work right with "man -Tlp stuff | lpr"... you
	   get the stupid escape sequences written out on the hardcopy.
	   I guess pg don't look at -T
--
=======================================================================
#include <std/disclaimer.h>
                                 =:^)
           Jim Jagielski                    NASA/GSFC, Code 711.1
     jim@jagubox.gsfc.nasa.gov               Greenbelt, MD 20771

"Kilimanjaro is a pretty tricky climb. Most of it's up, until you reach
 the very, very top, and then it tends to slope away rather sharply."

jim@jagubox.gsfc.nasa.gov (Jim Jagielski) (11/15/90)

In article <3918@dftsrv.gsfc.nasa.gov> I ramble:
>
>
>	2) pg don't work right with "man -Tlp stuff | lpr"... you
>	   get the stupid escape sequences written out on the hardcopy.
>	   I guess pg don't look at -T


The reason why (idiot) is that the TERM variable isn't EXPORTED in the man
shell script! (Geez, some people just don't think :):):) 'Course, that's the
way Apple distributed it ;)

Once I added "export TERM" right above the "now print out pages" line in
/usr/bin/man, pg works fine!

Send me e-mail if you want more info...
--
=======================================================================
#include <std/disclaimer.h>
                                 =:^)
           Jim Jagielski                    NASA/GSFC, Code 711.1
     jim@jagubox.gsfc.nasa.gov               Greenbelt, MD 20771

"Kilimanjaro is a pretty tricky climb. Most of it's up, until you reach
 the very, very top, and then it tends to slope away rather sharply."

mikel@dtg.nsc.com (Michael G. Lohmeyer) (11/16/90)

In article <3919@dftsrv.gsfc.nasa.gov> jim@jagubox.gsfc.nasa.gov (Jim Jagielski) writes:
>Once I added "export TERM" right above the "now print out pages" line in
>/usr/bin/man, pg works fine!

     The /usr/bin/man script has been bugging me a lot too until tonight
when I read the postings about it.  I tried Jim's suggestion and it still
did not work for me (perhaps I didn't do it right, perhaps my version
of less affected things a little.  Anyway, I did get it work, however,
by changing the following line:

----------

if [ "$PAGER" = "" ]
then
	mypager="more -s"
else
	# Pages such as pg need to have ul handle underlining, but less
	# does not.  You may want to reflect this difference in your PAGER
	# enviroment variable (e.g.  setenv PAGER "ul | pg" or 
	# setenv PAGER "less -s").

	#  mypager="ul | $PAGER"		# use for pg
	mypager="$PAGER"			# use for less
fi

----------

     The original version of man just had the line:

	mypager="ul | $PAGER"

(along with a slightly different comment above it).  This may work fine
for the pg command, but ul in front of my less gave me a lot of garbage,
so I made the change above and it seems to work great.  I didn't even
have to export the TERM variable as Jim suggested.  I am running A/UX V2.0
in case it matters.

Mike
-------------
Mike Lohmeyer				mikel@dtg.nsc.com
National Semiconductor Corporation	...!dtg.nsc.com!mikel
(408) 721-8075

jim@jagubox.gsfc.nasa.gov (Jim Jagielski) (11/17/90)

In article <1526@berlioz.nsc.com> mikel@berlioz.UUCP (Michael G. Lohmeyer) writes:
>In article <3919@dftsrv.gsfc.nasa.gov> jim@jagubox.gsfc.nasa.gov (Jim Jagielski) writes:
>>Once I added "export TERM" right above the "now print out pages" line in
>>/usr/bin/man, pg works fine!
>
>      /* some changes to /usr/bin/man deleted for space */
>
>(along with a slightly different comment above it).  This may work fine
>for the pg command, but ul in front of my less gave me a lot of garbage,
>so I made the change above and it seems to work great.  I didn't even
>have to export the TERM variable as Jim suggested.  I am running A/UX V2.0
>in case it matters.
>


The problem with TERM seems to only take affect when one is using the -T
option to man...

For example, -Tlp prints out some garbage when using pg (don't know about
less, have to try it out) and piping the output to lpr.

As I understand it, eval spawns a shell to run it's argument. Although
TERM in defined in man, it's not exported to the eval shell, although
the TERM of the main process (ie. me, when calling man) is exported (as things
are set up on my Mac)... so the pager sees MY TERM, and not man's, unless
TERM is exported to pager.

At least, I think so ;)
--
=======================================================================
#include <std/disclaimer.h>
                                 =:^)
           Jim Jagielski                    NASA/GSFC, Code 711.1
     jim@jagubox.gsfc.nasa.gov               Greenbelt, MD 20771

"Kilimanjaro is a pretty tricky climb. Most of it's up, until you reach
 the very, very top, and then it tends to slope away rather sharply."