Well... that was an interesting night of experimentation. Thanks for
the idea about stty (which I didn't know about), because otherwise I
might have gone mad (apparently COLUMNS isn't set in the environment of
a shell script... which makes sense when one thinks about it).
Regardless, I ended up finding two solutions.
First, I created the following shell script.
#v+
dave@heffalump:~$ cat bin/man.sh
#!/bin/sh
mpage=`man -w $1`
tcols=`stty -a | grep columns | awk '{ print $6 }'`
zcat -f `man -w $1` | groff -Tutf8 -man -rIN=7n -rLL=`echo ${tcols} - 3 | bc`n - | less
#v-
That did the job, but made `man -k`, which my fingers find familiar,
unusable. I remembered you were running a CURRENT snapshot, so figured
I'd check the difference between man in HEAD and 8.1-RELEASE... WOW!
The man in HEAD is now a shell script.
That inspired a second solution: Take the shell script from HEAD, and
install it for my user's use. So, I checked out the man from HEAD.
svn checkout svn://svn.freebsd.org/base/head/usr.bin/man
I installed fakeroot (needed to install the man pages).
The Makefile doesn't honor PREFIX, but does honor BINDIR/MANDIR, so I
used the following command-line to install the man from HEAD.
fakeroot make install BINDIR=/home/dave/usr/bin MANDIR=/home/dave/usr/man/man NO_MANCOMPRESS="YES"
Whoops! The program and man pages installed, but man pages were not
displayed using the number of columns. Apparently there's more to the
modified behavior in HEAD than just the man display program... but the
new man is a shell script so I can modify it.
I applied the following patch.
#v+
--- man.sh.orig 2011-01-19 22:41:34.000000000 -0600
+++ man.sh 2011-01-19 22:41:33.000000000 -0600
@@ -891,9 +891,10 @@
search_whatis whatis "$@"
}
+cols=`stty -a | grep columns | awk '{ print $6 }'`
EQN=/usr/bin/eqn
COL=/usr/bin/col
-NROFF='/usr/bin/groff -S -Wall -mtty-char -man'
+NROFF='/usr/bin/groff -S -Wall -mtty-char -man -rLL=`echo $cols - 3 | bc`n'
PIC=/usr/bin/pic
SYSCTL=/sbin/sysctl
TBL=/usr/bin/tbl
#v-
I installed again, and done!
So, more gymnastics than I would like, but now man uses the current
number of columns. I'll use this method until the new shell script
version in HEAD makes it into the base of a release I'm running.
Thanks to all for the information and inspiration!
Regards,
--
dave [ please don't CC me ]
[...]
> That did the job, but made `man -k`, which my fingers find familiar,
> unusable. I remembered you were running a CURRENT snapshot, so figured
> I'd check the difference between man in HEAD and 8.1-RELEASE... WOW!
> The man in HEAD is now a shell script.
In ancient times man was originally a shell script. What is old is new again.
--
David Kelly N4HHE, dke...@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"
Nice! I'll check with our groff maintainer(s) to see if they have plans
to MFC the latest man/groff stuff.
Is this a consequence of the move to mdocml instead of groff?
No, we are still using groff's groff_mdoc(7) package for authoring
manpage content.
That would be excellent, thank you!