Update of bug #68151 (group groff):
Status: None => In Progress
Assigned to: None => gbranden
Planned Release: None => 1.25.0
Summary: [troff] throw warning in "style" category when end
of sentence detected before end of text line => [PATCH] [troff] throw warning
in "style" category when end of sentence detected before end of text line
_______________________________________________________
Follow-up Comment #1:
diff --git a/ANNOUNCE b/ANNOUNCE
index 9c963e169..a951b7bc4 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -207,6 +207,7 @@ of this release.
instance with "grep -i -A1 thanks ChangeLog". A manual merge of
similar from the contrib/ change log files may also be necessary. ]]
+Alex Colomar
Bob Friesenhahn
Bruno Haible
Zack Weinberg
diff --git a/ChangeLog b/ChangeLog
index 1c3d493d4..fead03ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-03-14 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment::space): Throw warning in
+ category "style" if the end of a sentence is detected before the
+ end of a text line.
+
+ * doc/groff.texi.in (Warnings):
+ * src/roff/troff/troff.1.man (Warnings): Document it.
+
+ Fixes <https://savannah.gnu.org/bugs/?68151>. Thanks to Alex
+ Colomar for the original feature request.
+
2026-03-14 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (struct warning_category): Add new
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index a1553907b..9986d0b37 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -21534,7 +21534,8 @@
@itemx 16
Input was non-idiomatic or likely to produce an unexpected result
(or none at all),
-but is not invalid.
+but is not invalid:
+the end of a sentence was detected prior to the end of a text line.
@item scale
@itemx 32
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index db0aecd1f..b9db99ca1 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -566,6 +566,8 @@ void environment::space(hunits space_width, hunits
sentence_space_width)
&& node_list_ends_sentence(p->next) == 1) {
hunits xx = translate_space_to_dummy ? H0 : sentence_space_width;
if (p->did_space_merge(xx, space_width, sentence_space_width)) {
+ warning(WARN_STYLE, "end of sentence detected before end of text"
+ " line");
*tp += xx;
return;
}
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index 010a68ea2..39fdd7372 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -812,7 +812,8 @@ .SH Warnings
style 16 T{
Input was non-idiomatic or likely to produce an unexpected result
(or none at all),
-but is not invalid.
+but is not invalid:
+the end of a sentence was detected prior to the end of a text line.
T}
.
.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68151>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
