URL: <https://savannah.gnu.org/bugs/?67380>
Summary: [troff] advise that `ab` request doesn't flush a
partially collected line
Group: GNU roff
Submitter: gbranden
Submitted: Wed 30 Jul 2025 11:34:51 PM GMT
Category: Core
Severity: 1 - Wish
Item Group: Documentation
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 30 Jul 2025 11:34:51 PM GMT By: G. Branden Robinson <gbranden>
In bug #56500, Dave raised the point that *roff programs generally don't flush
the standard output stream when processing an `ab` request.
A partially collected line, possibly of considerable length, can accumulate
prior to an `ab` request being encountered, which is then silently discarded
when the request is processed. That behavior can mislead the author about
"where" the `ab` request took place, or what formatting operations
successfully occurred. Traditionally, *roff programs interpret an `ab`
request as an instruction to abort formatting and take the quickest path to
program exit that it can while still being tidy (closing open file streams and
so forth, but not writing a document "trailer"--see _groff_out_(5)).
One scenario for `ab` use is that a document has called a macro with an
unacceptable argument, and the macro author regards this as a fatal mistake
after which fruitful formatting is impossible. When that is the case, the
contents of the partially collected line are likely not important. (The macro
author should emit an intelligible diagnostic message to the standard error
stream using the `tm` family or requests, or as arguments to `ab` itself.)
On the other hand, an author may be using `ab` in an attempt to debug their
document or macro. When doing so, it's valuable for the abort to be
"synchronous" with the document formatting process. To achieve that, they'll
need to use the `fl` request to flush the pending output line prior to the
abort. Our documentation should advise them of this fact, but it does not.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67380>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
