[TUHS] Proliferation of options is great simplification of pipes, really?

G. Branden Robinson g.branden.robinson at gmail.com
Tue Feb 23 07:14:29 AEST 2021


Hi John,
At 2021-02-22T10:49:52-0500, John P. Linderman wrote:
> I can imagine a simple perl (or python or whatever) script that would
> run through groff input, determine which preprocessors are *actually*
> needed, and set up a pipeline to run through (only) the needed
> preprocessors in the proper order.

This is _almost_ what the groff grog(1) command does.  It's been present
as far back as our history goes, to groff 1.02 in June 1991.

* It's a Perl script.
* It uses pattern-matching heuristics to infer which arguments groff(1)
  will need to format the document (not just for preprocessors, but
  macro packages as well).
* Depending on its own options, it writes the constructed command to
  stderr, executes it, or both.

The only thing it doesn't handle is ordering, because groff(1) already
takes care of that.

> I wouldn't have to tell groff what preprocessors I think are needed,
> and groff wouldn't have to change (although my script would) when
> another preprocessor comes into existence. Modern processors are fast
> enough, and groff input small enough, that the "extra" pass wouldn't
> be burdensome. And it would take the burden off me to remember exactly
> which preprocessors are essential. -- jpl

We don't get a lot of bug reports about grog.  Maybe it's not given
enough prominence in groff's own documentation.

Regards,
Branden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210223/19148822/attachment.sig>


More information about the TUHS mailing list