This is the mail archive of the
mailing list for the Cygwin project.
Re: Manual page width is fixed and I'd like it not to be
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 23 Nov 2004 16:12:11 -0800
- Subject: Re: Manual page width is fixed and I'd like it not to be
- Organization: My own little world...
- References: <email@example.com>
- Reply-to: cygwin at cygwin dot com
> 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 http://lists.gnu.org/archive/html/groff/2003-03/msg00038.html
> -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:
\_ sh -c (echo '.ll 126n'; /usr/bin/zsoelim /tmp/zmanc7tnnh) | \
/usr/bin/tbl | /usr/bin/nroff -mandoc -rLL=126n -rLT=126n \
-Tascii | less
\_ /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
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: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html