gbranden pushed a commit to branch master
in repository groff.
commit 81646e5a553110f16a803b9b043f47244a3cf55a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Dec 29 05:31:17 2025 -0600
src/roff/troff/input.cpp: Trivially refactor.
* src/roff/troff/input.cpp
(do_terminal)
(terminal)
(terminal1)
(terminal_continue): Rename these...
(terminal_write)
(terminal_message_request)
(terminal_message1_request)
(terminal_message_continuation_request): ...to these.
(init_input_requests): Update wire-uppery.
---
ChangeLog | 13 +++++++++++++
src/roff/troff/input.cpp | 30 ++++++++++++++++--------------
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f5233e740..cc3244f26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2025-12-29 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp: Trivially refactor.
+ (do_terminal)
+ (terminal)
+ (terminal1)
+ (terminal_continue): Rename these...
+ (terminal_write)
+ (terminal_message_request)
+ (terminal_message1_request)
+ (terminal_message_continuation_request): ...to these.
+ (init_input_requests): Update wire-uppery.
+
2025-12-29 G. Branden Robinson <[email protected]>
[troff]: Trivially refactor for clarity. "asciify" is one of
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 0d0413a2b..afa58f957 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8160,8 +8160,8 @@ void taga()
// interpretation only in compatibility mode. We still wouldn't need
// `tm1` because a compatibility mode document could say ".do tm foo".
-static void do_terminal(bool do_append_newline,
- bool interpret_leading_spaces)
+static void terminal_write(bool do_append_newline,
+ bool interpret_leading_spaces)
{
if (has_arg(true /* peek */)) {
int c;
@@ -8185,22 +8185,24 @@ static void do_terminal(bool do_append_newline,
tok.next();
}
-static void terminal()
+// old and busted
+static void terminal_message_request() // .tm
{
- do_terminal(true /* do append newline */ ,
- false /* interpret leading spaces */);
+ terminal_write(true /* do append newline */ ,
+ false /* interpret leading spaces */);
}
-static void terminal1()
+// the new hotness
+static void terminal_message1_request() // .tm1
{
- do_terminal(true /* do append newline */ ,
- true /* interpret leading spaces */);
+ terminal_write(true /* do append newline */ ,
+ true /* interpret leading spaces */);
}
-static void terminal_continue()
+static void terminal_message_continuation_request() // .tmc
{
- do_terminal(false /* do append newline */ ,
- true /* interpret leading spaces */);
+ terminal_write(false /* do append newline */ ,
+ true /* interpret leading spaces */);
}
struct grostream : object {
@@ -10254,9 +10256,9 @@ void init_input_requests()
init_request("sy", system_request);
init_request("tag", tag);
init_request("taga", taga);
- init_request("tm", terminal);
- init_request("tm1", terminal1);
- init_request("tmc", terminal_continue);
+ init_request("tm", terminal_message_request);
+ init_request("tm1", terminal_message1_request);
+ init_request("tmc", terminal_message_continuation_request);
init_request("tr", translate);
init_request("trf", transparent_throughput_file_request);
init_request("trin", translate_input);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit