Re: Proposed: make `pwh` request (formerly `ptr`) report diversion traps

"G. Branden Robinson" <[email protected]> Fri, 22 May 2026 11:20:00 -0500
Newsgroups gmane.comp.printing.groff.general
Message-ID <20260522162000.uu77iif7ung2bi6e@illithid>
[self-follow-up]

At 2026-05-19T17:06:20-0500, G. Branden Robinson wrote:
> I have a hunch that this feature change is sufficiently useful,
> harmless, and esoteric that I've gone ahead and implemented it, but
> not yet pushed it.

Having received no feedback, this proposed change will likely be in my
next push, which I expect to do today or tomorrow.

I thought I'd clarify a detail.

> The proposed behavior change is to make `pwh` report the properties of
> a diversion trap if one is present, instead of reporting nothing.
> 
> Another possible solution would be to implement a new request called
> "pdt" to report this information, but, to me, the mutual exclusivity of
> page location and diversion traps, and the desirability of not further
> growing the request repertoire unnecessarily argued against it.  It's
> won't be difficult to change the code to hook this feature up to a new
> "pdt" request instead of "pwh" if people would prefer that.  (In a
> sense, that would be the more "orthogonal" solution.)
> 
> I do have a moderately strong feeling that the report should be
> available via _some_ means.

One might reasonably point out the following AT&T troff feature.

groff(7):
     \n[.t]         Distance to next vertical position trap; see wh and
                    ch.  If no such traps exist between the drawing
                    position and the bottom of the page, troff
                    interpolates the distance to the page bottom.
                    Within a diversion, in the absence of a diversion
                    trap, this distance is the maximum possible vertical
                    position supported by the output device.

That's true as far as it goes, which is "ahead of the current drawing
position in the diversion (top-level or otherwise)".

The `pwh` feature remains useful, as it exists today and with this
proposed enhancement, because it informs you of the presence of vertical
position traps _regardless_ of the drawing position, and describes not
just where the traps are but what macro is associated with each.

(I see that I need to clarify the quoted language above--"in the absence
of a diversion trap" isn't quite correct, as noted in the foregoing
paragraph.)

Regards,
Branden
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmoQgiUACgkQ0Z6cfXEm
bc4TqA/9EvvNSoXnk+9sC2UDsCtU9lZyCrzsg0s9+hI60fasLS4AJLJ5QGTLWbrb
+aMKsAwmiNi4U3n3jr3A9J6Xww9d8DC0rvqC0FH68CmpvNE7TL/Vpc0ZoXTV1YMK
CxNr5LPtth4XHQ2g29lNARzNk1AZXbt9phma9XumXXFl3SVcgklHJlZapDS87MN+
YoEyWORxe/zjguSMsMKMicP6WLXnxgiJuXrc17PZ8U6QUbJ/J6VTWtxtalPgNaSb
B7bmhM67Hd7lbCSPFhzgJGQ2oLH382uxBK2x9geYbdiN9pzKJgkba0G39YBLEFpJ
zGyqNteZtzZWFwuF1VMqL69bOjwmtJv/oyJmBZNcWs4XxDCvk07G5g+65psmf28z
oXSO1eP0oLixoYdEnawko6KRa7b89sFjTHn6JyImZ7Pgcf4D3K+mSIShlfcfWMiR
Hk6Ea/zxJSD/xHWVTGDuFzU+k84PG0TStFWxEyG35kY9nbC8/7lS+4JPRbylodPA
IIGKg/dcsfoud2GUmaocuOrZm6c146URfFSOidn2MghLdxWDYy19ISkvcGcWKnWS
iJEBtJCMrSFZYjsv9eqgBFYTxjwOQOZDMfLbJPTY02x/4uV3d3Qay23JshN9AGbc
8UfK9nnR4epXNenANx5pqrZseUiwnX7X8wWNnQ2cVho4WsofNmU=
=HuNZ
-----END PGP SIGNATURE-----