bugGNU roff - Bugs: bug #59443, [tbl] constructed formatter...

 
 

bug #59443: [tbl] constructed formatter diagnostics should identify table context

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Tue 10 Nov 2020 05:35:23 PM UTC
   
 
Category:  Preprocessor tbl Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Mar 2022 10:16:23 PM UTC, comment #3: 


commit fb52df3b263a8a9da5b0cc3bf04755e2b06935be
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Nov 11 18:18:41 2020 +1100

    [tbl]: Add "table" to in-page diagnostic message.

    * src/preproc/tbl/table.cpp (table::compute_separation_factor): Add word
      "table" to diagnostic message to better cue the user that it is
      produced by roff that has been injected into the document by the
      tbl(1) preprocessor.  The other 3 such possible diagnostic messages
      already do this.  Thanks to Bjarni Ingi Gislason for bringing the
      inconsistency to light.

    Fixes <https://savannah.gnu.org/bugs/?59443>.


G. Branden Robinson <gbranden>
Group administrator
Wed 11 Nov 2020 08:05:10 AM UTC, comment #2: 

Fixed in fb52df3b263a8a9da5b0cc3bf04755e2b06935be.

G. Branden Robinson <gbranden>
Group administrator
Wed 11 Nov 2020 07:07:03 AM UTC, comment #1: 

I somewhat disagree with Bjarni's analysis.

tbl itself can issue diagnostics, and it can produce roff language constructs that may cause the production of diagnostics

Whether the latter category of diagnostics actually issues depends on conditions at the time the document is formatted.

Therefore, I think the current arrangement, where in the document basically "complains about itself", is more correct than the alternative Bjarni proposes.

However, I do note that of the messages Bjarni proposes to patch, only one is missing the word "table" in the text of the actual message part.  I think it would be helpful to mention tables there, too, somewhat like the following.


     prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
     prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
-           ".tm1 \" column separation set to zero\n"
+           ".tm1 \" table column separation set to zero\n"
            ".nr " SEPARATION_FACTOR_REG " 0\n");


I'll work on this, as a welcome break from the 100+ man page fix-up commits I have pending.

G. Branden Robinson <gbranden>
Group administrator
Tue 10 Nov 2020 05:35:23 PM UTC, original submission:  

  Add "tbl:" to diagnostic messages.

  The GNU standard recommends the following:

"   Error messages from other noninteractive programs should look like
this:

     PROGRAM:SOURCEFILE:LINENO: MESSAGE

when there is an appropriate source file, or like this:

     PROGRAM: MESSAGE

when there is no relevant source file.
"

  This mark should reduce the risk that users blame a command,
that itself uses "tbl" internally, like "man",
for the diagnostic,
and report it to the maintainers of that software.

  This is an addition to comply to the bug report #52463.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 src/preproc/tbl/table.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 5f8ac27a..25e3f198 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1860,7 +1860,7 @@ void table::init_output()
            /* Since we turn off traps, it won't get into an infinite
               loop when we try and print it; it will just go off the
               bottom of the page. */
-           ".  tmc \\n[.F]: around line \\n[.c]: warning:\n"
+           ".  tmc tbl:\\n[.F]: around line \\n[.c]: warning:\n"
            ".  tm1 \" table row will not fit on page \\n%\n"
            ".\\}\n"
            ".nf\n"
@@ -1891,7 +1891,7 @@ void table::init_output()
            ".nr " SAVED_DN_REG " \\n[dn]\n"
            ".ne \\n[dn]u+\\n[.V]u\n"
            ".ie \\n[.t]<=\\n[" SAVED_DN_REG "] \\{\\\n"
-           ".  tmc \\n[.F]: around line \\n[.c]: error:\n"
+           ".  tmc tbl:\\n[.F]: around line \\n[.c]: error:\n"
            ".  tmc \" table will not fit on page \\n%;\n"
            ".  tm1 \" use .TS H/.TH with a supporting macro package\n"
            ".\\}\n"
@@ -2153,7 +2153,7 @@ void table::compute_expand_width()
            "delim off\n"
            ".EN\n"
            "..\n");
-    prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
+    prints(".tmc tbl:\\n[.F]: around line \\n[.c]: warning:\n"
            ".tm1 \" table wider than line width\n");
     prints(".ig\n"
            ".EQ\n"
@@ -2205,7 +2205,7 @@ void table::compute_separation_factor()
            "delim off\n"
            ".EN\n"
            "..\n");
-    prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
+    prints(".tmc tbl:\\n[.F]: around line \\n[.c]: warning:\n"
            ".tm1 \" column separation set to zero\n"
            ".nr " SEPARATION_FACTOR_REG " 0\n");
   }
@@ -2213,7 +2213,7 @@ void table::compute_separation_factor()
          ".el .if \\n[" SEPARATION_FACTOR_REG "]<1n \\{\\\n");
   entry_list->set_location();
   if (!(flags & NOWARN)) {
-    prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
+    prints(".tmc tbl:\\n[.F]: around line \\n[.c]: warning:\n"
            ".tm1 \" table squeezed horizontally to fit line length\n");
     prints(".ig\n"
            ".EQ\n"
--
2.28.0


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-05 gbranden Item GroupFeature change Warning/Suspicious behaviour
    2022-03-05 gbranden Summary[PATCH] src/preproc/tbl/table.cpp: add &quot;tbl:&quot; to diagnostic messages [tbl] constructed formatter diagnostics should identify table context
    2020-11-11 gbranden StatusNone Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2020-11-10 barx Carbon-CopyRemoved 93119 -
    2020-11-10 barx SummaryPATCH] src/preproc/tbl/table.cpp: add &quot;tbl:&quot; to diagnostic messages [PATCH] src/preproc/tbl/table.cpp: add "tbl:" to diagnostic messages

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code