Groff appears to lack the idea of a horizontal trap, but I find I need pretty much exactly that functionality. Has anyone developed a macro or other mechanism to simulate this?
Here's what I'm trying to do. I have a lengthy input file to be processed in no-fill mode. For 99% of this file, that will work just fine: that is, the input lines will fit within the the page. A few lines, however, are too long for the page, and in no-fill mode groff happily sends them past the margin and even past the edge of the paper. I don't want groff to handle these lines; the exact way each such line should be handled depends on a number of factors and really requires manual intervention. But I do want groff to alert me to such cases, so that I know where to find them without having to flip through a couple hundred pages of output. The obvious solution is to set a horizontal trap near the right-hand edge of the page, and have groff .tm a warning whenever that trap is triggered. The one flaw is the lack of such a trap. At the moment, no other solution comes to mind, though it seems like it should be easy in principle. Anyone have ideas? Trivial example. Groff should warn about the third line of text: .nf Short line. Another short line. This line is too long for the page, and I would like groff to give me some indication that it's flowing over the margin, so that I can do something about it. This line is fine.