Hi folks, Addition of a formatter warning in the new "style" category has revealed what I think is another dark and dusty corner of the *roff language.
First a quick recap of the `ti` request.
groff(7):
.ti ±N Temporarily indent next output line (default scaling
unit m).
The argument is mandatory; GNU troff can complain if it's omitted.
$ echo .ti | groff -ww -z
troff:<standard input>:1: warning: temporary indentation request expects
argument [-w missing]
I propose to make an argumentless `ti` invocation meaningful.
Another point to note is that not having a temporary indentation _is
not_ the same thing as a temporary indentation of zero. A temporary
indentation is not applied to whatever the next output line's
indentation would otherwise be: it is a total override.
Quoting Savannah #68286:
("story.mm" is in our Git repository.[1])
---snip---
We have a use case in our "story.mm" document.
$ head -n 15 contrib/mm/examples/story.mm
.\" groff -K utf8 -mm
.nr Pt 1
.SP 1i
.\" ti \" XXX: if only we had a way to cancel a pending temporary indent
.ce 3
.B "The Oval Portrait"
.SP
.I "E.\& A.\& Poe"
.SP
.ce 0
.if t .2C
.P
The château into which my valet had ventured to make forcible entrance,
rather than permit me,
in my desperately wounded condition,
An _mm_ author *has* to use roff requests here. They can't just drop in
`TL` and `AU` as they might with ms(7); a document type has to be set up
first. (If you try, all of DWB 3.3, Heirloom Doctools, Plan 9, and
Solaris 10 troffs get angry and refuse to format the document.)
For us, the foregoing works fine. (If you bust it down to US-ASCII, it
works fine with Plan 9, DWB 3.3, Heirloom Doctools, and Solaris 10
troffs too.)
However, my new post-1.24.1 "style" warning category squawks.
$ ./build/test-groff -ww -k -mm -T utf8 contrib/mm/examples/story.mm | head
-n 15
troff:contrib/mm/examples/story.mm:5: warning: ignoring temporary
indentation while centering request in effect [-w style]
‐ 1 ‐
The Oval Portrait
E. A. Poe
The château into which my valet had ventured to make
forcible entrance, rather than permit me, in my desperately
wounded condition, to pass a night in the open air, was one
of those piles of commingled gloom and grandeur which have
Our _mm_ package sets up a temporary indentation in some
header-strap-sprung stuff. That holds until text is encountered. Here,
it's stymied by the use of a request to configure centering.
Above I illustrate where I might cancel this unexpected temporary
indentation in my document.
Of course we might alter _groff mm_ to get itself out of this situation,
relieving the document author of having to grasp the fact that the macro
package configured a temporary indentation.
...but how?
Once a temporary indentation is configured, you're stuck with its
existence (albeit not its magnitude) until the next output line is set
and spat out into the current diversion. That fact applies just as much
to macro package authors as to document authors.
With normal indentation, applicable to the pending output line, you can
jimmy the indentation as much as you want until the line breaks, at
which point its last configuration wins.
But a temporary indentation endures until it has discharged its
task--even if its amount is the same as the `in` indentation and is
therefore nilpotent. There's no going back.
There should be.
---end snip---
Thoughts? Objections? Please follow-up to this thread or to the
Savannah ticket.
https://savannah.gnu.org/bugs/?68286
Regards,
Branden
[1]
https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/examples/story.mm?h=1.24.1
signature.asc
Description: PGP signature
