gbranden pushed a commit to branch master
in repository groff.
commit c97ccbf43b0c632578d50afcbf29566df71e07da
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Oct 8 03:18:50 2025 -0500
[mdoc]: Improve diags when continuously rendering.
* tmac/mdoc/doc-common (doc-end-document): Fix syntax/logic error
arising from forgetting that groff's mdoc macros are mostly defined
with the escape character switched off, meaning one has to pay extra
attention when copying and pasting between groff man and groff mdoc.
When continuously rendering, truncate page length to vertical drawing
position only after formatting the last document on the input stream.
This way, when troff emits diagnostic messages regarding the output,
it reports a position of the form "page 1, line N", where "N" is a
number you can usefully give to `sed -n Np` in a pipeline after
nroff/troff/groff/ grotty.
---
ChangeLog | 14 ++++++++++++++
tmac/mdoc/doc-common | 6 ++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b489e9423..63db5c43c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-10-08 G. Branden Robinson <[email protected]>
+
+ * tmac/mdoc/doc-common (doc-end-document): Fix syntax/logic
+ error arising from forgetting that groff's mdoc macros are
+ mostly defined with the escape character switched off, meaning
+ one has to pay extra attention when copying and pasting between
+ groff man and groff mdoc. When continuously rendering, truncate
+ page length to vertical drawing position only after formatting
+ the last document on the input stream. This way, when troff
+ emits diagnostic messages regarding the output, it reports a
+ position of the form "page 1, line N", where "N" is a number you
+ can usefully give to `sed -n Np` in a pipeline after
+ nroff/troff/groff/grotty.
+
2025-10-08 G. Branden Robinson <[email protected]>
[mdoc]: Regression-test useful output file line numbers reported
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index e8a2e0d5e..9234c6f3e 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -1239,15 +1239,13 @@
\D'l \n[doc-line-length]u 0'
. fi
. \}
-. \" suppress empty lines after the footer
-. pl \n[nl]u
. \}
. ch doc-header
. \" At the end of the last document, the file name becomes empty;
. \" force the page length to match the vertical drawing position in
. \" continuous rendering mode.
-. ie \\n[cR] .if '\\n[.F]'' .pl \\n[nl]u
-. el .doc-break-page-with-new-number
+. ie \n[cR] .if '\n[.F]'' .pl \n[nl]u
+. el .doc-break-page-with-new-number
..
.ec
.
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit