Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread Giorgos Keramidas
On Wed, 19 Jan 2011 22:51:45 -0600, David J. Weller-Fahy 
dave-lists-freebsd-questi...@weller-fahy.com wrote:
 * Giorgos Keramidas keram...@ceid.upatras.gr [2011-01-19 02:57 -0500]:
 On Tue, 18 Jan 2011 12:29:18 -0600, David Kelly dke...@hiwaay.net wrote:
  On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
  Set the 'columns' attribute of your tty:
  stty columns 60
  man xxx
 
  *Should*? You posted without trying it? (I tried, did not work).

 'Should' as in I tried it here and it worked.  I'm running a recent
 CURRENT snapshot, but I don't think this affects the results.  What
 does 'stty -a' show in your terminal?  What is your shell's
 environment (e.g. the value of COLUMNS)?  What is your PAGER? etc.

 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.

Nice!  I'll check with our groff maintainer(s) to see if they have plans
to MFC the latest man/groff stuff.



pgpxKqg0Mxboi.pgp
Description: PGP signature


Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread Charlie Kester

On Wed 19 Jan 2011 at 21:36:19 PST David Kelly wrote:


On Jan 19, 2011, at 10:51 PM, David J. Weller-Fahy wrote:

[...]


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.


Is this a consequence of the move to mdocml instead of groff?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread Giorgos Keramidas
On Thu, 20 Jan 2011 10:02:56 -0800, Charlie Kester corky1...@comcast.net 
wrote:
 In ancient times man was originally a shell script. What is old is new
 again.

 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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread David J. Weller-Fahy
* Giorgos Keramidas keram...@ceid.upatras.gr [2011-01-20 06:03 -0500]:
 On Wed, 19 Jan 2011 22:51:45 -0600, David J. Weller-Fahy 
 dave-lists-freebsd-questi...@weller-fahy.com wrote:
  Regardless, I ended up finding two solutions.
 
 Nice!  I'll check with our groff maintainer(s) to see if they have
 plans to MFC the latest man/groff stuff.

That would be excellent, thank you!

Regards,
-- 
dave [ please don't CC me ]


pgpJuNrcD0Jyz.pgp
Description: PGP signature


Re: How to adjust man page line length

2011-01-19 Thread Giorgos Keramidas
On Tue, 18 Jan 2011 12:29:18 -0600, David Kelly dke...@hiwaay.net wrote:
 On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
 On Mon, 17 Jan 2011 21:40:38 -0600, David J. Weller-Fahy
 dave-lists-freebsd-questi...@weller-fahy.com wrote:
 To expand on the question in the subject: How does one tell `man`
 not to automatically format man pages to 80 columns?  I'm looking
 for a fairly easy way to do this, or confirmation it would involve
 internal gymnastics I may not be willing to perform.

 Set the 'columns' attribute of your tty:

 stty columns 60
 man xxx

 This should do it.

 *Should*? You posted without trying it? (I tried, did not work).

'Should' as in I tried it here and it worked.  I'm running a recent
CURRENT snapshot, but I don't think this affects the results.  What does
'stty -a' show in your terminal?  What is your shell's environment
(e.g. the value of COLUMNS)?  What is your PAGER? etc.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length [SOLVED]

2011-01-19 Thread David J. Weller-Fahy
* Giorgos Keramidas keram...@ceid.upatras.gr [2011-01-19 02:57 -0500]:
 On Tue, 18 Jan 2011 12:29:18 -0600, David Kelly dke...@hiwaay.net wrote:
  On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
  Set the 'columns' attribute of your tty:
  stty columns 60
  man xxx
 
  *Should*? You posted without trying it? (I tried, did not work).
 
 'Should' as in I tried it here and it worked.  I'm running a recent
 CURRENT snapshot, but I don't think this affects the results.  What
 does 'stty -a' show in your terminal?  What is your shell's
 environment (e.g. the value of COLUMNS)?  What is your PAGER? etc.

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.0 -0600
+++ man.sh  2011-01-19 22:41:33.0 -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 ]


pgpD8pPdV0bdR.pgp
Description: PGP signature


Re: How to adjust man page line length

2011-01-19 Thread David J. Weller-Fahy
* Polytropon free...@edvax.de [2011-01-18 13:44 -0500]:
 man2pdf.sh:
 
   #!/bin/sh
   [ $1 !=  ]  zcat `man -w $1` | \
   groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf - $1.pdf
 
 This would cause groff to format for A4 paper width.  It's fully
 possible that a similar approach can be used for requesting a specific
 terminal width given in characters, rather than inches or centimeters
 (from a predefined value).

I forgot to mention in the [SOLVED] email - thank you for mentioning the
groff command-line, as it helped in both the initial and final
solutions.

Regards,
-- 
dave [ please don't CC me ]


pgp6SA90YtmPq.pgp
Description: PGP signature


Re: How to adjust man page line length

2011-01-19 Thread David J. Weller-Fahy
* David Kelly dke...@hiwaay.net [2011-01-18 07:05 -0500]:
 As for the request not to be CC'ed in reply, put the list address in
 the Reply-To: header as I have done here.

I started to last night, and realized I couldn't devise a simple way to
do so automatically for all lists I subscribe to without keeping a list
of the lists I subscribe to... (other than my mailboxes: one for each
list)... but I haven't devoted much time to it yet.

I have a feeling it will involve a reply-hook, and that others have
already accomplished it, but I'll try another time.  For now think of it
as a polite request which, if not complied with, will cause no ill will.

Regards,
-- 
dave [ please don't CC me ]


pgpR7HMmo3BKz.pgp
Description: PGP signature


Re: How to adjust man page line length [SOLVED]

2011-01-19 Thread David Kelly

On Jan 19, 2011, at 10:51 PM, David J. Weller-Fahy wrote:

[...]

 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-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length

2011-01-18 Thread David Kelly

On Jan 17, 2011, at 9:40 PM, David J. Weller-Fahy wrote:

 To expand on the question in the subject: How does one tell `man` not to
 automatically format man pages to 80 columns?  I'm looking for a fairly
 easy way to do this, or confirmation it would involve internal
 gymnastics I may not be willing to perform.

Perhaps FreeBSD should look into using man from MacOS X where man -c
will do as requested above. Will format to the output device width.

For FreeBSD I suspect the solution involves man -t and then studying
how to tell groff(1) to format for one's console rather than the default
Postscript output. man -t generates very nice printable man pages.

As for the request not to be CC'ed in reply, put the list address in the
 Reply-To: header as I have done here.

--
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length

2011-01-18 Thread Giorgos Keramidas
On Mon, 17 Jan 2011 21:40:38 -0600, David J. Weller-Fahy 
dave-lists-freebsd-questi...@weller-fahy.com wrote:
 To expand on the question in the subject: How does one tell `man` not to
 automatically format man pages to 80 columns?  I'm looking for a fairly
 easy way to do this, or confirmation it would involve internal
 gymnastics I may not be willing to perform.

Set the 'columns' attribute of your tty:

stty columns 60
man xxx

This should do it.



pgpweCUC8F7Dj.pgp
Description: PGP signature


Re: How to adjust man page line length

2011-01-18 Thread David Kelly
On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
 On Mon, 17 Jan 2011 21:40:38 -0600, David J. Weller-Fahy 
 dave-lists-freebsd-questi...@weller-fahy.com wrote:
  To expand on the question in the subject: How does one tell `man`
  not to automatically format man pages to 80 columns?  I'm looking
  for a fairly easy way to do this, or confirmation it would involve
  internal gymnastics I may not be willing to perform.
 
 Set the 'columns' attribute of your tty:
 
 stty columns 60
 man xxx
 
 This should do it.

*Should*? You posted without trying it? (I tried, did not work).

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length

2011-01-18 Thread Polytropon
On Tue, 18 Jan 2011 06:48:13 -0600, David Kelly dke...@hiwaay.net wrote:
 
 On Jan 17, 2011, at 9:40 PM, David J. Weller-Fahy wrote:
 
  To expand on the question in the subject: How does one tell `man` not to
  automatically format man pages to 80 columns?  I'm looking for a fairly
  easy way to do this, or confirmation it would involve internal
  gymnastics I may not be willing to perform.
 
 Perhaps FreeBSD should look into using man from MacOS X where man -c
 will do as requested above. Will format to the output device width.
 
 For FreeBSD I suspect the solution involves man -t and then studying
 how to tell groff(1) to format for one's console rather than the default
 Postscript output. man -t generates very nice printable man pages.

I'd like to mention - although this might not be a full
answer to the OP's initial question - that this is
similarly done when converting manual pages to PS or
PDF output for better printing.

man2pdf.sh:

#!/bin/sh
[ $1 !=  ]  zcat `man -w $1` | \
groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf - $1.pdf

This would cause groff to format for A4 paper width.
It's fully possible that a similar approach can be used
for requesting a specific terminal width given in
characters, rather than inches or centimeters (from
a predefined value).


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


How to adjust man page line length

2011-01-17 Thread David J. Weller-Fahy
To expand on the question in the subject: How does one tell `man` not to
automatically format man pages to 80 columns?  I'm looking for a fairly
easy way to do this, or confirmation it would involve internal
gymnastics I may not be willing to perform.

The quick fixes which did not work: I ensured COLUMNS is set in the
environment, I tried pages which did not have a corresponding catman
page, I tried on the console and in X, and I've tried both with my
custom (SC_PIXEL_MODE added) and GENERIC kernels.

I'm running...
#v+
dave@heffalump:~$ uname -a
FreeBSD heffalump.weller-fahy.com 8.1-RELEASE-p2 FreeBSD 8.1-RELEASE-p2 #0: Sat 
Jan  1 10:59:17 CST 2011 
r...@heffalump.weller-fahy.com:/usr/obj/usr/src/sys/GENERIC-SC_PIXEL_MODE  i386
#v-

This particular installation is running under Virtualbox 3.2.12 r68302
on Mac OS X 10.6.6.

Admittedly, this is an annoyance rather than a need, but man is it
annoying.  Will someone please let me know the simple thing my google-fu
has failed to find?

Regards,
-- 
dave [ please don't CC me ]


pgpuYmTIj89FG.pgp
Description: PGP signature


Re: How to adjust man page line length

2011-01-17 Thread Dan Nelson
In the last episode (Jan 17), David J. Weller-Fahy said:
 To expand on the question in the subject: How does one tell `man` not to
 automatically format man pages to 80 columns?  I'm looking for a fairly
 easy way to do this, or confirmation it would involve internal gymnastics
 I may not be willing to perform.

For FreeBSD-originated manpages, it looks like the line length is taken from
the .ll and .lt definitions in /usr/share/tmac/mdoc/doc-nroff .  If you
comment them out, you get the groff default width of 6 inches.  I don't know
if groff can pull values from environment variables or the physical TTY.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org