G. Branden Robinson <[email protected]> wrote:
>
> At 2026-08-21T22:00:06-0400, kollar wrote:
>> I’ve been going through UTP, getting ready to start UTP Revisited,
>
> Oh, good! I hope you noticed
> <https://github.com/larrykollar/Unix-Text-Processing/pull/9>.
That’s not the only pull request. I’ll go through them and apply them
to the 2.0 (revisited) branch.
> They probably don't _own_ all of Ultrix's code. This is a perennial
> problem with proprietary code bases. Deals get done and stuff from
> third parties gets grafted in without any thought given to distributing
> the work as a whole in the future under FLOSS terms.
Yeah, good point. But it would be good if someone with connections
could convince them to open at least the checkmm code.
>> The magic box, which does often talk nonsense, went on to say (direct
>> quote this time. minus Markdown markup):
>>
>>> Modern Linux systems use GNU Troff (groff). Instead of a standalone
>>> checkmm binary, groff implements macro checking natively. When you
>>> run "groff -mm -b -w w yourfile.mm", the -b (backtrace) and -w w
>>> (enable all warnings) flags will automatically detect and print
>>> syntax errors, unmatched macros, or structural issues.
>
> Yes. This is broadly correct.
Wow. I’ve learned to be skeptical of AI output, especially when dealing
with not-exactly-mainstream topics. That duck.ai got it right is… well,
encouraging.
>> Groff’s diagnostics are useful, but can it detect unclosed macro
>> pairs and structural issues?
>
> Precise terminology can be helpful.
>
> GNU troff is the formatter, and no, it can't. It has no mechanism for
> tracking macro "pairing".
>
> A macro package itself, however, _can_.
>
> Here's the set of error diagnostics implemented in groff mm in Git HEAD.
> (Actually, this is from my working copy, but I haven't added any
> lately.)
Wow again! Nice job, adding those diagnostics!
>> Now if it really can, putting “alias checkmm groff -mm -b -ww” in our
>> .profile would give us an easy replacement.
>
> I'd add "-z" because you want only the errors, not formatted output.
Amazing. So I’ll add something to the effect:
If you are using Groff, its -mm implementation builds in diagnostics that
cover most of the issues `checkmm` looks for. Thus, you can easily create
your own `checkmm` utility by adding the following line to your Bash profile:
alias checkmm groff -mm -b -ww -z
When you issue the command `checkmm files.mm`, Groff prints a list of
issues that it finds in the files.
(I’ll probably revise this, but it’s a start. I can also point to the Ultrix
source
for those using Plan9 derivatives.)
— Larry