Follow-up Comment #2, bug #68252 (group groff): Having said all THAT ...stuff...
It occurred to me to try to find out what this replacement `TH` is trying to
actually do.
So let's compare them.
Here's Version 7 Unix "tmac.an"'s `TH` definition.
$ sed -n '/\.de TH/,/^\.\./p' ./HISTORY/MAN/1979-01-v7/tmac.anv7
.de TH
.PD
.if n .nr IN .5i
.if t .nr IN .5i
.nr LL \\n(.l
.ds ]H \\$1\|(\|\\$2\|)
.ds ]D UNIX Programmer's Manual
.ds ]L \\$3
.wh 0 }H
.if t .wh -1i }F
.if n .wh -1.167i }F
.em }M
.if \\n(nl .bp 1
.}E
.DT
.nr )I .5i
.nr )R 0
.if n .na
..
Notice how it's written legibly. McIroy++, USG Weenies--.
Then there's this thing, from "750ops.8" and presumably other USG documents,
which I shall argue does not differ sufficiently from the liberally licensed
Version 7 Unix's macro definition sufficiently to warrant its own copyright
protection (in other words, there's no "marginal" or "differential"
"originality" here)...
$ sed -n '/\.deTH/,/^\.\./p' ./SPECIMENS/clem-man-page/750ops.8 | cat -v
.deTH
.PD
.nrIN \\n()Mu
.ift .ds ]H \\$1\^(\^\\$2\^)
.ifn .ds ]H \\$1(\\$2)
.if\\n()s .ds ]D
.if\\n()t .ds ]D UNIX System V
.ifn .ds ]D UNIX System V
.ds]L
.if!^G\\$3^G^G .ds ]L (\^\\$3\^)
.if!^G\\$4^G^G .ds ]D \\$4
.wh0 }H
.wh-\\n(:mu }F
.em}M
.if\\n(nl .bp
.nr)I \\n()Mu
.nr)R 0
.}E
.DT
.ifn \{.na
.nh\}
.ift \{.bd S 3 3
.hy14 \}
..
Let me enumerate the differences.
1. The `IN` register is now initialized from the undocumented `)M` register.
Possibly because Unix System III (1980) exposed (documented) `IN`.
2. The initialization of `LL` disappears. The same story for the same reason
as #1, I suspect.
3. Header and footer content are redefined. This is a notorious site of Unix
vendor hackery. _groff man_ has supported hook macros, `PT` and `BT`, for
this purpose for 23 years. They're documented in the man page.
4. String (strictly, formatted output) comparisons are done to conditionalize
header population on the emptiness of arguments to `TH`.
5. The page location trap at the bottom of the page (to break the text and set
the footer) is now not hard-coded but parameterized in the (undocumented,
double secret probation) `:m` register. In _groff man_, you can control this
value via the `FT` register. It's documented in the man page.
6. Unix Version 7 _man_ reset the page number to 1 at each new document. USG
_man_ appears not to. In _groff man_, this is configurable via the documented
`C` register. (SunOS 2.0 had it first.)
7. The `)I` register gets a layer of indirection through the aforementioned
undocumented register, `)M`.
8. USG _man_ disables hyphenation in _nroff_ mode. In _groff man_, this is
configurable via the documented `HY` register.
9. USG _man_ resets the hyphenation mode (applicable only if enabled) to "14".
Unix Version 7 _man_ did the same, but only at package load time, meaning
that if a _man_(7) document fooled with the hyphenation mode, it could affect
other, unrelated pages. This issue grieves people even decades later; see bug
#67363.
10. USG _man_ sets up overstrike-based emboldening of the special font
whenever a glyph from it is needed and the currently selected font mounting
position is "3". Traditionally in *roff, the font "B" (bold) is assigned to
that position.
My conclusion?
Everything useful that USG _man_'s `TH` replacement macro does can be achieved
through configuration parameters that _groff man_ exposes and documents.
How to proceed, apart from fixing bugs identified in _groff_?
It might be worthwhile to write a "preloadable" macro file, called
"ansvr2.tmac", for example, to (a) configure Unix System V Release 2-ish
defaults via _groff man_'s interfaces for the parameters instead of macro
hackery, and (b) interpose a redefined `de` request to intercept an attempt to
redefine the `TH` macro, and discard or ignore any such redefinition. Getting
this to work correctly with and without `-mandoc` will require close
attention.
But the solution I envision would look like this:
$ groff -t -C -m ansvr2 -m andoc -T pdf SPECIMENS/clem-man-page/750ops.8
I'll conclude with a gripe that USG **could** have accomplished everything
they wanted by _appending_ to the `TH` macro instead of replacing it. `TH`
itself produces no output: it only sets traps and configures parameters. That
means that any unsatisfactory Unix Version 7 _man_ default could have been
easily overridden in this way.
.am TH
.\" yadda
..
So I am cross with the engineer behind this, whoever (if anyone) reviewed
their change, and their entire management chain. Let their names be spoken
that I may express my scorn for the whole Internet to see.
Thoughts?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68252>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
