bugGNU roff - Bugs: bug #61477, [tbl] "nowarn" should...

 
 

bug #61477: [tbl] "nowarn" should suppress "table row will not fit" warning as well

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 13 Nov 2021 11:38:11 PM UTC
   
 
Category:  Preprocessor tbl Severity:  1 - Wish
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 20 Nov 2021 10:23:56 AM UTC, comment #4: 


commit 45aeaeb06899b21e5615aa910c3d58ac4e728ea7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Nov 15 17:10:18 2021 +1100

    [tbl]: If "nowarn", suppress table row warning.

    * src/preproc/tbl/table.cpp (table::init_output): Bracket the generated
      groff code that emits a warning if a table row overruns a page
      location trap (usually, is too long to vertically fit on the page) in
      a test for whether the "nowarn" region option was given, so that this
      warning is suppressed as well when that option is used.
    * src/preproc/tbl/tbl.1.man (Region options): Document new "nowarn"
      behavior.

    ("nokeep" also suppresses this warning, for a different reason; no
    diversion is created to hold the table row, so its vertical size does
    not exist to be compared to the distance to the next page trap.)

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

    You can generate a document to test with the following.

    (printf '.TS\nL.\nT{\n.nf\n'; seq 1 71; printf 'T}\n.TE\n') > foo.roff


G. Branden Robinson <gbranden>
Group administrator
Sat 20 Nov 2021 10:23:03 AM UTC, comment #3: 


comment #2:

>
> original submission:
> > The tbl "nowarn" option within a .TS/.TE region disables 3 of the 4 possible warnings that can be emitted when *roff formats the table.  These 3 all have to do with potential horizontal truncation or ugliness of the table.
> >
> > The fourth has to do with vertical truncation or ugliness, and is unconditional.
> >
> > Should the semantics of "nowarn" be broadened to cover this last type of warning?
> >
>   Not now, new information should not be hidden form users.


"New" relative to what?  All of these warnings are quite old.

The three already affected date to 2013 at the latest, and the one I propose to affect dates to 1993.

Further, I reason that when we name an option "nowarn" and tell people it disables warnings, it should do so within its domain of application (tbl(1)-generated *roff code).

G. Branden Robinson <gbranden>
Group administrator
Wed 17 Nov 2021 07:53:22 PM UTC, comment #2: 


original submission:

> The tbl "nowarn" option within a .TS/.TE region disables 3 of the 4 possible warnings that can be emitted when *roff formats the table.  These 3 all have to do with potential horizontal truncation or ugliness of the table.
>
> The fourth has to do with vertical truncation or ugliness, and is unconditional.
>
> Should the semantics of "nowarn" be broadened to cover this last type of warning?
>

  Not now, new information should not be hidden form users.

Bjarni Ingi Gislason <bjarniig>
Mon 15 Nov 2021 06:19:14 AM UTC, comment #1: 

The lack of a NOWARN conditional bracket around this diagnostic appears to be an oversight.

The diagnostic in question goes back to James Clark in 1993 (commit 71e9155c33) and it was not touched all the way through groff 1.22.4.

Werner added the "nowarn" region option to tbl(1) and the underlying C++ NOWARN flag in commit 065f04d6371bdf108a9cb34630e06b817b0a8e80, 16 February 2010.

I can't imagine why Joe Q. Tbl-User would want to be bothered about truncation of a text block in the vertical dimension but not the truncation of table entries of any sort in the horizontal one, so I'll proceed.

G. Branden Robinson <gbranden>
Group administrator
Sat 13 Nov 2021 11:38:11 PM UTC, original submission:  

The tbl "nowarn" option within a .TS/.TE region disables 3 of the 4 possible warnings that can be emitted when *roff formats the table.  These 3 all have to do with potential horizontal truncation or ugliness of the table.

The fourth has to do with vertical truncation or ugliness, and is unconditional.

Should the semantics of "nowarn" be broadened to cover this last type of warning?


1880            ".if \\n[.t]<=\\n[" SAVED_DN_REG "] \\{\\\n"
1881            /* Since we turn off traps, it won't get into an infinite
1882               loop when we try and print it; it will just go off the
1883               bottom of the page. */
1884            ".  tmc \\n[.F]: around line \\n[.c]: warning:\n"
1885            ".  tm1 \" table row will not fit on page \\n%\n"
1886            ".\\}\n"

2170   if (!(flags & NOWARN)) {
2171     // protect ` and ' in warning message against eqn
2172     prints(".ig\n"
2173            ".EQ\n"
2174            "delim off\n"
2175            ".EN\n"
2176            "..\n");
2177     prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
2178            ".tm1 \" table wider than line width\n");
2179     prints(".ig\n"
2180            ".EQ\n"
2181            "delim on\n"
2182            ".EN\n"
2183            "..\n");
2184     prints(".nr " EXPAND_REG " 0\n");
2185   }

2222   if (!(flags & NOWARN)) {
2223     // protect ` and ' in warning message against eqn
2224     prints(".ig\n"
2225            ".EQ\n"
2226            "delim off\n"
2227            ".EN\n"
2228            "..\n");
2229     prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
2230            ".tm1 \" table column separation set to zero\n"
2231            ".nr " SEPARATION_FACTOR_REG " 0\n");
2232   }

2236   if (!(flags & NOWARN)) {
2237     prints(".tmc \\n[.F]: around line \\n[.c]: warning:\n"
2238            ".tm1 \" table squeezed horizontally to fit line length\n");
2239     prints(".ig\n"
2240            ".EQ\n"
2241            "delim on\n"
2242            ".EN\n"
2243            "..\n");
2244   }


G. Branden Robinson <gbranden>
Group administrator

 

(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 bjarniig (Posted a comment)
  • -email is unavailable- added by gbranden (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-20 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
        Summary[tbl] &quot;nowarn&quot; should suppress &quot;table row will not fit warning&quot; as well [tbl] "nowarn" should suppress "table row will not fit" warning as well
    2021-11-15 gbranden StatusNeed Info In Progress
        Assigned toNone gbranden

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code