gbranden pushed a commit to branch master
in repository groff.

commit 5496bf85b7fdde87c0477abd15c59d770d868b51
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Mar 14 09:37:29 2026 -0500

    [troff]: Fix Savannah #62776 ("style" warnings).
    
    * src/roff/troff/input.cpp (struct warning_category): Add new warning
      category, "style" (with symbol `WARN_STYLE`).  Suppress its enablement
      from the `-wall` command-line option shorthand, as categories "di",
      "mac", and "reg" are.  I expect much noise from historical documents
      in forthcoming applications of this category, and AT&T troff syntax is
      too loosely specified to support some of the ideas I have in mind.
    
    * doc/groff.texi.in (Warnings):
    * src/roff/troff/troff.1.man (Warnings):
    * NEWS: Document it.
    
    Fixes <https://savannah.gnu.org/bugs/?62776>.
---
 ChangeLog                  | 16 ++++++++++++++++
 NEWS                       |  4 ++++
 doc/groff.texi.in          | 11 +++++------
 src/roff/troff/input.cpp   |  3 ++-
 src/roff/troff/troff.1.man | 19 +++++++++----------
 src/roff/troff/troff.h     |  1 +
 6 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8c792c036..1c3d493d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2026-03-14  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (struct warning_category): Add new
+       warning category, "style" (with symbol `WARN_STYLE`).  Suppress
+       its enablement from the `-wall` command-line option shorthand,
+       as categories "di", "mac", and "reg" are.  I expect much noise
+       from historical documents in forthcoming applications of this
+       category, and AT&T troff syntax is too loosely specified to
+       support some of the ideas I have in mind.
+
+       * doc/groff.texi.in (Warnings):
+       * src/roff/troff/troff.1.man (Warnings):
+       * NEWS: Document it.
+
+       Fixes <https://savannah.gnu.org/bugs/?62776>.
+
 2026-03-14  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (read_request): Boolify and rename
diff --git a/NEWS b/NEWS
index bdb002fc1..b4790c877 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,10 @@ troff
    lines remaining to be be underlined in the environment (as configured
    by either the `cu` or `ul` requests).
 
+*  A new warning category, "style" is supported.  It is used to diagnose
+   input that is non-idiomatic or likely to produce an unexpected result
+   (or none at all), but is not invalid.
+
 
 VERSION 1.24.1
 ==============
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 8aa31feef..6c7f615f1 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -21599,12 +21599,11 @@ release may reject ambiguous delimiters.
 In compatibility mode,
 ambiguous delimiters are accepted without warning.
 
-@c @item el
-@c @itemx 16
-@c @cindex @code{ie} request, and warnings
-@c @cindex @code{el} request, and warnings
-@c The @code{el} request was encountered with no prior corresponding
-@c @code{ie} request.  @xref{if-else}.
+@item style
+@itemx 16
+Input was non-idiomatic or likely to produce an unexpected result
+(or none at all),
+but is not invalid.
 
 @item scale
 @itemx 32
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8f42d7fcf..68a691423 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -10612,6 +10612,7 @@ static struct warning_category {
   { "range", WARN_RANGE },
   { "break", WARN_BREAK },
   { "delim", WARN_DELIM },
+  { "style", WARN_STYLE },
   { "scale", WARN_SCALE },
   { "syntax", WARN_SYNTAX },
   { "tab", WARN_TAB },
@@ -10626,7 +10627,7 @@ static struct warning_category {
   { "ig", WARN_IG },
   { "color", WARN_COLOR },
   { "file", WARN_FILE },
-  { "all", WARN_MAX & ~(WARN_DI | WARN_MAC | WARN_REG) },
+  { "all", WARN_MAX & ~(WARN_STYLE | WARN_DI | WARN_MAC | WARN_REG) },
   { "w", WARN_MAX },
   { "default", DEFAULT_WARNING_CATEGORY_SET },
 };
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index eddadf32e..341a5a658 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -576,7 +576,7 @@ _
 1@2@\fIunused\fP@11@2048@tab
 2@4@break@12@4096@\fIunused\fP
 3@8@delim@13@8192@missing
-4@16@\fIunused\fP@14@16384@input
+4@16@style@14@16384@input
 5@32@scale@15@32768@escape
 6@64@range@16@65536@space
 7@128@syntax@17@131072@font
@@ -670,15 +670,6 @@ diversion.
 T}
 .
 .
-.\" .TP
-.\" .BR el "\t16"
-.\" The
-.\" .B el
-.\" request was encountered with no prior corresponding
-.\" .B ie
-.\" request.
-.
-.
 .sp \n[PD]u
 escape 32768   T{
 An unsupported escape sequence was encountered.
@@ -818,6 +809,14 @@ T}
 .
 .
 .sp \n[PD]u
+style  16      T{
+Input was non-idiomatic or likely to produce an unexpected result
+(or none at all),
+but is not invalid.
+T}
+.
+.
+.sp \n[PD]u
 syntax 128     T{
 A self-contradictory hyphenation mode or character flags were requested;
 an empty or incomplete numeric expression was encountered;
diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h
index ac0d9c489..fd29514d8 100644
--- a/src/roff/troff/troff.h
+++ b/src/roff/troff/troff.h
@@ -54,6 +54,7 @@ enum warning_type {
   WARN_BREAK = 04,
   WARN_DELIM = 010,
   //WARN_EL = 020, // withdrawn in groff 1.24
+  WARN_STYLE = 020, // introduced in groff 1.25
   WARN_SCALE = 040,
   WARN_RANGE = 0100,
   WARN_SYNTAX = 0200,

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

Reply via email to