groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Re: manual pages and terminal width


From: Ruslan Ermilov
Subject: [Groff] Re: manual pages and terminal width
Date: Mon, 29 Apr 2002 13:48:45 +0300
User-agent: Mutt/1.3.27i

On Sat, Apr 27, 2002 at 02:39:36PM +0200, Werner LEMBERG wrote:
> 
> Sorry for the long delay in handling this.
> 
> Andreas Gr"unbacher wrote about a month ago:
> 
> > groff has the very convenient feature that manual pages are
> > formatted dependent on the terminal width, if invoked through
> > man.  (If invoked directly it does not do the trick).
> 
> Actually, it is possible:
> 
>   echo ".ll 78n" | groff -ww - -man -Tlatin1 groff_font.n | less
> 
> > Unfortunately this only works for -man style pages, but not for
> > -mdoc.
> 
> Yes, I agree that it would be a good feature if mdoc could do the
> same.
> 
> > So I have started to play with the mdoc macros a bit and found that
> > changing the ll and lt macros seems to lead to the desired effect.
> 
> Note that .ll and .lt are not macros but built-in requests.
> 
> After some thinking I believe it is best to handle mdoc similar to
> man, i.e., to not use .ll and .lt at all.
> 
> Ruslan has sent me the opposite patch, namely to set .ll and .lt to
> 78n in an-old.mdoc, but I think that should be handled by the `man'
> program, not the macro package itself -- at least `man' should have a
> chance to change it.
> 
> Thus I suggest the following:
> 
>   . Remove the calls to .ll and .lt in mdoc.
> 
OK.

>   . The `man' program should define number registers `LL' and `LT'
>     instead of setting .ll and .lt directly.
> 
I think a single `LL' register for both would DTRT.

>   . I will add code to both the man and mdoc macro packages to use a
>     default value of 78n for the line and title length if LL and LT
>     are not set (and 6.5i in troff mode).
> 
That looks acceptable.  But beware that many man(1) distributions have
an ability to create the so-called "catpages", compiled version of the
respective manpages.  A catpage serves as a "cache" for future readers
of the same manpage.  Catpages may be pre-created at install time, or
created at run-time.  One possible solution to the problem it creates
is to create/look for catpages only if the respective option to set
the line length from man(1) was not used.

> Backwards compatibility with old macro packages should be possible by
> testing gtroff's version registers.
> 
OK.


Cheers,
-- 
Ruslan Ermilov          Sysadmin and DBA,
address@hidden          Sunbay Software AG,
address@hidden          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

Attachment: pgpne_oEvdkNh.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]