Subject: Re: groff update?
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Thomas Klausner <wiz@netbsd.org>
List: tech-userlevel
Date: 02/17/2003 12:47:32
On Sun, Feb 16, 2003 at 02:49:34PM +0100, Jaromir Dolecek wrote:
> I've recently bumped to the silly limit for number of arguments
> in our tmac macros again. Apparently the macros have been extensively
> changed to allow arbitrary number of arguments, sometime post
> 1.16.1 (which we have in tree according to doc/3RDPARTY).
> E.g. FreeBSD uses 1.18.1 including the nonchanged groff tmac macros.
> 
> Is there any particular reason to stay with 1.16? Why the upgrade
> to 1.17.2, which was announced 2001/10/19, wasn't done?

I agree that we should just switch to the groff-supplied macros.
They are written in a much cleaner way and don't have some problems ours
have, like the 9-argument limitation.

The switch wasn't done mostly because of .Nm.
When used with punctuation, our current .Nm needs a dummy argument
of two double quotes, e.g.:
	.Nm "" .
With groff's mdoc package, plain
	.Nm .
works, but the groff maintainers explicitly do not want to support
the dummy argument (I asked, they refused).
We could switch all in-tree man pages to the new syntax for the switch,
but then man pages from older releases wouldn't be displayed correctly.
Additionally, you wouldn't be able to display new-syntax man pages on
older releases.

So for the switch to happen, we'd need to do two things:
a) teach the new mdoc package the .Nm "" syntax
b) teach the old mdoc package the .Nm . syntax, and pull it up to
   the branches
Step b is not so important, since we could delay the change
to ``.Nm .´´ if the new mdoc package supports the dummy argument,
but I think the no-dummy-argument syntax is much cleaner.

Additionally, groff>=1.18 (or 1.18.1, don't know exactly) produces
ANSI escape sequences instead of N^HN syntax (to support colour)
but we could undo this part easily in-tree, or perhaps teach less
and more to accept it by default too (less needs the -R option for
it, haven't looked at more yet).

mdoc hackers to improve .Nm are welcome, I can supply more details
or a test file.

Cheers,
 Thomas