gbranden pushed a commit to branch master
in repository groff.
commit 6d0c19300ad5976f1591edfe325c6f2274214772
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Mar 1 21:46:14 2024 -0600
[troff]: Trivially refactor.
...to clarify a function's purpose.
* src/roff/troff/env.cpp (init_hyphen_requests): Rename this...
(init_hyphenation_pattern_requests): ...to this.
* src/roff/troff/input.cpp (main): Update call site.
* src/roff/troff/request.h: Update declaration.
---
ChangeLog | 7 +++++++
src/roff/troff/env.cpp | 6 +++++-
src/roff/troff/input.cpp | 2 +-
src/roff/troff/request.h | 2 +-
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f67ddcba1..06d9dd6f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-03-01 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (init_hyphen_requests): Rename this...
+ (init_hyphenation_pattern_requests): ...to this.
+ * src/roff/troff/input.cpp (main): Update call site.
+ * src/roff/troff/request.h: Update declaration.
+
2024-03-01 G. Branden Robinson <[email protected]>
[troff]: Add `.hydefault` read-only register storing the
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 457749b8d..6856b304d 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -4044,6 +4044,8 @@ const char *hyphenation_default_mode_reg::get_string()
#define init_string_env_reg(name, func) \
register_dictionary.define(name, new string_env_reg(&environment::func))
+// Most hyphenation functionality is environment-specific; see
+// init_hyphenation_pattern_requests() below for globally managed state.
void init_env_requests()
{
init_request("ad", adjust);
@@ -4284,7 +4286,9 @@ static void append_hyphenation_patterns_from_file()
read_hyphenation_patterns_from_file(true /* append */);
}
-void init_hyphen_requests()
+// Most hyphenation functionality is environment-specific; see
+// init_env_requests() above.
+void init_hyphenation_pattern_requests()
{
init_request("hla", select_hyphenation_language);
init_request("hpf", load_hyphenation_patterns_from_file);
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 4b157dfe1..c1f22b5d9 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8486,7 +8486,7 @@ int main(int argc, char **argv)
register_dictionary.define(".T", new readonly_text_register(tflag ? "1" :
"0"));
init_registers();
init_reg_requests();
- init_hyphen_requests();
+ init_hyphenation_pattern_requests();
init_environments();
while (string_assignments) {
do_string_assignment(string_assignments->s);
diff --git a/src/roff/troff/request.h b/src/roff/troff/request.h
index 1511f5230..f60b670f6 100644
--- a/src/roff/troff/request.h
+++ b/src/roff/troff/request.h
@@ -82,7 +82,7 @@ extern void init_div_requests();
extern void init_node_requests();
extern void init_reg_requests();
extern void init_env_requests();
-extern void init_hyphen_requests();
+extern void init_hyphenation_pattern_requests();
extern void init_request(const char *, REQUEST_FUNCP);
class charinfo;
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit