gbranden pushed a commit to branch master
in repository groff.

commit d6f79851bf9317190647be2b5ec4ea867ec34e41
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 3 05:01:53 2026 -0500

    src/roff/troff/node.cpp: `bd` can style-warn now.
    
    * src/roff/troff/node.cpp (embolden_font_request): Throw warning in
      category "style" if request arguments are ambiguous.  This could
      arguably be made an error since the ambiguity is inherent; it shows up
      in Kernighan troff (see CSTR #54, 1992 revision).  But let's try a
      style warning first.  See Savannah #62776.
    
    Illustration:
    $ echo '.bd 11 38' | ./build/test-groff -ww
    troff:<standard input>:1: warning: interpreting second argument to font 
emboldening request as emboldening amount; consider using a font name instead 
of a mounting position as the first argument if conditional emboldening desired 
[-w style]
---
 ChangeLog               | 8 ++++++++
 src/roff/troff/node.cpp | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e7895bb82..971714da9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-04-03  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp (embolden_font_request): Throw warning
+       in category "style" if request arguments are ambiguous.  This
+       could arguably be made an error since the ambiguity is inherent;
+       it shows up in Kernighan troff (see CSTR #54, 1992 revision).
+       But let's try a style warning first.  See Savannah #62776.
+
 2026-04-03  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.cpp (translate_font)
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 9730380ea..c9d094eb1 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7377,7 +7377,10 @@ static void embolden_font_request() // .bd
        font_table[f]->conditional_unbold(n);
     }
     else {
-      // The second argument must be an emboldening amount.
+      warning(WARN_STYLE, "interpreting second argument to font"
+             " emboldening request as emboldening amount; use a font"
+             " name instead of a mounting position as the first"
+             " argument if conditional emboldening desired");
       units offset;
       if (read_measurement(&offset, 'u') && (offset >= 1))
        font_table[n]->set_bold(hunits(offset - 1));

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

Reply via email to