This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Manual page width is fixed and I'd like it not to be

Dave wrote:

> Attached is a patch to man.conf, providing a (hacked) solution allowing MANWIDTH
> to work (here at least). Only intended as a short term fixup for those who need
> it :). Will need some work if you want it to cope with term resizing.
> Thanks to

> -NROFF          /usr/bin/nroff -c -mandoc 2>/dev/null
> +NROFF          /usr/bin/nroff -c -mandoc -rLL=`echo $MANWIDTH`n -rLT=`echo $MANWIDTH`n 2>/dev/null

Just a little more info about how debian does this, in case someone
wants to flesh this out for it to do "the right thing".

>From Debian's "man man":

              If $MANWIDTH is set, its  value  is  used  as  the  line
              length  for  which manual pages should be formatted.  If
              it is not set, manual pages will  be  formatted  with  a
              line  length  appropriate to the current terminal (using
              an ioctl(2) if available,  the  value  of  $COLUMNS,  or
              falling  back to 80 characters if neither is available).
              Cat pages will only be saved when the default formatting
              can  be  used,  that is when the terminal line length is
              between 66 and 80 characters.

I think they must be using their own patched version of man which adds
all of the above functionality.  "man --version" says "man, version
2.4.2, 2003-09-20".  It has no man.conf that I can find.

On a 130 char wide screen, running man results in the following process
tree, from ps --forest:

man man
 \_ sh -c (echo '.ll 126n'; /usr/bin/zsoelim /tmp/zmanc7tnnh) | \
    /usr/bin/tbl | /usr/bin/nroff -mandoc -rLL=126n -rLT=126n \
    -Tascii | less
     \_ /usr/bin/tbl
     \_ /bin/sh /usr/bin/nroff -mandoc -rLL=126n -rLT=126n -Tascii
     |   \_ groff -mtty-char -Tascii -mandoc -rLL=126n -rLT=126n
     |       \_ troff -mtty-char -mandoc -rLL=126n -rLT=126n -Tascii
     |       \_ grotty
     \_ less

So it would appear that the "-rLL" and "-rLT" thing is the way to go. 
I'm not familiar enough with nroff to know what the ".ll 126n" one is
necessary for, presumably so that tables are formatted to the proper
width as well.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]