Proposed: `ti` without arguments cancels temporary indentation

"G. Branden Robinson" <[email protected]> Tue, 28 Apr 2026 22:03:21 -0500
Newsgroups gmane.comp.printing.groff.general
Message-ID <20260429030321.xdld3zpxxdrmmay5@illithid>
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 (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmnxdO8ACgkQ0Z6cfXEm
bc56dg/9E8KAsoV0qDESVtM7ZwDVVj0uyktE7JxwB367YycMDGyXi/1rrVTioD58
R03dLkIlJ0RpYk6CGdUbQbzzebHkpUetW1cuKmLj2MLzYAiX6ErYogefB6PcbwNP
35mZnKITBmXlzfGtBJoe0YsZjsUzBkoX7xJzZP26rN7jP/9z/1dro4/y8jAAUXWo
FR/owkKV9XM8nCpkew6LUT9eaPYOI9z6L6gtei+Rx6tUmVxG7Jh1oXU0Cz6+QgdY
LD9SJvj/c9zXPIzjApo76eP06bwMvjkHBENs52ZQoLnaBz4LmV3eWPkwKo2i/2N7
3WRCU09xk/tLHwjkouryX79iwTXtX2qx7ef4k03f3/Cr9/kJmC+hXVylF8ytBrp2
LrU5CSHAaVadY4OrUdMQFXMGFD9SG9hH9XNNVWP1m8phjgBj+HkJ5lNqYdPmjOjy
Pwj1KqIq5li7Vg7JGMFdV7SYdlMbtYXhf9AQF/arDjg1V0VCtCsTOu0xeEG2KoOR
02EuQyhdPlPIGg6SWVOvJWl91sSu+pyHUWzNc0M3tbWSwlTP5v5icf0FhYUI+NVo
9K0HPjsnZKLjHFQuZL+AdvRrgo+4tPPB6xYTx62Rukt2QTJ4PkLUsFQbwPxdrB4N
wgWHYMse9sNuKcBOLDLBgwK9GSWECNPP+XNjbi5mqB7LRSplzLY=
=aMlj
-----END PGP SIGNATURE-----