gbranden pushed a commit to branch master
in repository groff.

commit 513a58b12997507d077f932b9c4d78c86f5c82d5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Feb 7 03:59:19 2026 -0600

    [tbl]: Clarify formatting-time diagnostics.
    
    * src/preproc/tbl/table.cpp (table::compute_overall_width): Distinguish
      formatting-time diagnostics emitted when a table oversets; when the
      table is centered, note the fact because it might not overrun the line
      length but instead has reduced the indentation, which can be ugly in a
      different way.
    
    * src/preproc/tbl/tbl.1.man (Region options) <center>: Advise of
      circumstance in which formatting-time diagnostic is issued.
---
 ChangeLog                 | 11 +++++++++++
 src/preproc/tbl/table.cpp |  6 ++++--
 src/preproc/tbl/tbl.1.man |  1 +
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1efe87f1f..edfece445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-02-07  G. Branden Robinson <[email protected]>
+
+       * src/preproc/tbl/table.cpp (table::compute_overall_width):
+       Distinguish formatting-time diagnostics emitted when a table
+       oversets; when the table is centered, note the fact because it
+       might not overrun the line length but instead has reduced the
+       indentation, which can be ugly in a different way.
+
+       * src/preproc/tbl/tbl.1.man (Region options) <center>: Advise of
+       circumstance in which formatting-time diagnostic is issued.
+
 2026-02-06  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp: Revert refactoring from commit
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 57bbf05f5..fdceaa5b4 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -2304,8 +2304,10 @@ void table::compute_overall_width()
           ".EN\n"
           ".  .\n");
     entry_list->set_location();
-    prints(".  tmc \\n[.F]:\\n[.c]: warning:\n"
-          ".  tm1 \" table wider than line length minus indentation"
+    prints(".  tmc \\n[.F]:\\n[.c]: warning:\n");
+    if (flags & CENTER)
+      prints(".  tmc \" centered\n");
+    prints(".  tm1 \" table wider than line length minus indentation"
           "\n");
     prints(".  ig\n"
           ".EQ\n"
diff --git a/src/preproc/tbl/tbl.1.man b/src/preproc/tbl/tbl.1.man
index 5faeca814..48427b7ac 100644
--- a/src/preproc/tbl/tbl.1.man
+++ b/src/preproc/tbl/tbl.1.man
@@ -277,6 +277,7 @@ as a synonym.
 .B center
 Center the table region with respect to the line length,
 reducing the indentation if necessary
+(with a warning at formatting time)
 to make the table region fit;
 the default is to left-align it.
 .

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to