[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Groff's -mm Indexing
From: |
G. Branden Robinson |
Subject: |
Re: Groff's -mm Indexing |
Date: |
Fri, 30 Jun 2023 19:09:22 -0500 |
Hi Damian,
At 2023-07-01T01:20:44+1000, Damian McGuckin wrote:
> .INITI P
> .IND item0
> .IND item1
> .IND item2
> .INDO
The foregoing gives good exercise to new groff mm indexing system
validation logic, which will show up early in the next release cycle.
$ ./build/test-groff -rRef=1 -mm -z EXPERIMENTS/damian-index.mm
m.tmac:EXPERIMENTS/damian-index.mm:1: error: INITI: invalid index type 'P'
Fix that by switching the type to 'N' (or another valid choice
documented in the groff_mm(7) man page)...
$ ./build/test-groff -rRef=1 -mm -z EXPERIMENTS/damian-index.mm
m.tmac:EXPERIMENTS/damian-index.mm:2: error: IND: cannot record index entry
when not on a page
I put that diagnostic in today.
Fix that...
$ ./build/test-groff -ww -rRef=1 -mm -z EXPERIMENTS/damian-index.mm
.\" IND item0 1
.\" IND item1 1
.\" IND item2 1
troff:EXPERIMENTS/damian-index.mm:6: warning: macro 'INDO' not defined
(You'll notice a "-ww" crept into my command line.)
The macro is spelled "INDP". Fix that...[1]
$ ./build/test-groff -ww -rRef=1 -mm -z EXPERIMENTS/damian-index.mm
.\" IND item0 1
.\" IND item1 1
.\" IND item2 1
.\" Index: damian.ind
Splendid!
I've also added a unit test to validate this. It promptly exposed a bug
I'd introduced last month (on my private branch only).
Regards,
Branden
[1] This required yet another change to stop the package from shutting
all warnings off when the `Ref` register is non-zero. In my opinion
that is unhelpful and unnecessary. Diagnostics on stderr are
already distinguishable by dint of format; the macro package is
careful (and has been for many years) to write out this non-error
information prefixed with a *roff comment character sequence, which
is a pretty unlikely match for a diagnostic message produced by
anything even vaguely conforming to the GNU Coding Standards.
damian-index.mm
Description: Text Data
signature.asc
Description: PGP signature