gbranden pushed a commit to branch master
in repository groff.
commit 933eb009b6e965a3e7efd20d47e70844825831cd
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Dec 29 03:25:56 2025 -0600
src/roff/troff/env.cpp: Trivially refactor.
* src/roff/troff/env.cpp (break_output_line): Rename argument from
`want_adjustment` to `want_forced_adjustment` for clarity.
(break_without_adjustment): Rename this request handler...
(break_without_forced_adjustment_request): ...to this.
(break_with_adjustment): Rename this request handler...
(break_with_forced_adjustment_request): ...to this.
(init_env_requests): Update wire-uppery.
---
ChangeLog | 11 +++++++++++
src/roff/troff/env.cpp | 19 +++++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 429b2c5dd..3048d3512 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-12-29 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp: Trivially refactor.
+ (break_output_line): Rename argument from `want_adjustment` to
+ `want_forced_adjustment` for clarity.
+ (break_without_adjustment): Rename this request handler...
+ (break_without_forced_adjustment_request): ...to this.
+ (break_with_adjustment): Rename this request handler...
+ (break_with_forced_adjustment_request): ...to this.
+ (init_env_requests): Update wire-uppery.
+
2025-12-29 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp: Refactor. More cleanly separate input
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6a633ba06..6a226ab2f 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2640,21 +2640,24 @@ bool environment::is_empty()
&& pending_lines == 0 /* nullptr */;
}
-static void break_output_line(bool want_adjustment)
+// "Forced adjustment" refers to spreading of adjustable spaces (and
+// perhaps only that, even if in the future we implement "squeezing"),
+// when it is not normally called for, as at the end of a paragraph.
+static void break_output_line(bool want_forced_adjustment)
{
if (want_break)
- curenv->do_break(want_adjustment);
+ curenv->do_break(want_forced_adjustment);
}
-static void break_without_adjustment()
+static void break_without_forced_adjustment_request()
{
- break_output_line(false);
+ break_output_line(false /* want forced adjustment */);
skip_line();
}
-static void break_with_adjustment()
+static void break_with_forced_adjustment_request()
{
- break_output_line(true);
+ break_output_line(true /* want forced adjustment */);
skip_line();
}
@@ -4332,8 +4335,8 @@ const char *hyphenation_default_mode_reg::get_string()
void init_env_requests()
{
init_request("ad", adjust);
- init_request("br", break_without_adjustment);
- init_request("brp", break_with_adjustment);
+ init_request("br", break_without_forced_adjustment_request);
+ init_request("brp", break_with_forced_adjustment_request);
init_request("ce", center);
init_request("cu", continuous_underline);
init_request("ev", environment_switch);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit