[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OpenBSD groff package's troffrc file
From: |
G. Branden Robinson |
Subject: |
OpenBSD groff package's troffrc file |
Date: |
Mon, 17 Jul 2023 03:12:58 -0500 |
Hi Ingo,
While poking my nose around the Web to observe groff 1.23.0 uptake, I
noticed OpenBSD's patch to groff's troffrc file.
https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/textproc/groff/patches/patch-tmac_troffrc?rev=1.6&content-type=text/x-cvsweb-markup
The following change concerns me:
+.\" Disable adjustment by default,
+.\" such that manuals look similar with groff and mandoc(1).
+.ad l
+.de ad
+..
This is pretty extreme overkill for trying to get rendering parity
between mandoc(1) and groff on OpenBSD. Namely, you're (A) hitting
_every_ document and _every_ macro package with an altered default, not
just man pages, and (B) you're clobbering the formatter's `ad` request
so that _there is no way for any document using any macro package to
recover this feature_. This cripples groff for non-man page
applications that you don't mean for mandoc(1) to support.
I believe I have heard you say before that you don't want to mess with
patching (or maybe even shipping) groff's man.local or mdoc.local files
to fine-tune its behavior. If that is correct then I recommend the
following patch instead.
.do if !d AD .ds AD l
(Why "do"? troffrc in groff 1.23.0 is much more careful about trying to
ensure that it works even if the user turns AT&T compatibility mode on
at the command line.)
This employs the new groff 1.23.0 `AD` string supported by groff's
man(7) and mdoc(7). But it does so only if the user has not already set
that string on the [gnt]roff command line.
Because this does not destroy the `ad` request, it will be possible for
man pages to resurrect adjustment, and some do. In particular, I have
in mind a relentlessly applied pattern in the Linux man-pages, where
tbl(7) tables are bracketed more or less as follows.
.ad l
.hy 0
.TS
.\" whatever
.TE
.hy
.ad
Not only is this bad practice, it is pointless for tables that don't use
text blocks (so is over-applied) and doesn't fully work as intended
anyway. `hy` without an argument sets the automatic hyphenation mode to
`1`, not "the previous value", in the spirit of exuberant
non-orthogonality that animated early Bell Labs *roff development.
(I'm working on a sed-driven fix for Linux man-pages.)
(What if a table _does_ have text blocks?
groff tbl(1):
Text blocks are formatted as was the text prior to the table,
modified by applicable column descriptors. Specifically, the
classifiers A, C, L, N, R, and S determine a text block’s alignment
within its cell, but not its adjustment. Add na or ad requests to
the beginning of a text block to alter its adjustment distinctly
from other text in the document. As with other table entries, when
a text block ends, any alterations to formatting parameters are
discarded. They do not affect subsequent table entries, not even
other text blocks.
)
I think it is better to expose the errors of man pages using bad
practices (and/or poor portability to mandoc(1)) than to neuter a
fundamental feature of text formatting for all groff users on OpenBSD
who have gone to trouble to locate the port and install it.
What do you think?
Regards,
Branden
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- OpenBSD groff package's troffrc file,
G. Branden Robinson <=