[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 18/25: [troff]: Trivially refactor (`hw` request).
From: |
G. Branden Robinson |
Subject: |
[groff] 18/25: [troff]: Trivially refactor (`hw` request). |
Date: |
Sat, 4 Nov 2023 01:02:56 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 0878145a5a3c97914b4b08eca8b1e8f3dbd71dd3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 3 15:19:42 2023 -0500
[troff]: Trivially refactor (`hw` request).
* src/roff/troff/env.cpp: Clarify diagnostic and trivially refactor.
(hyphen_word): Rename this...
(add_hyphenation_exceptions): ...to this.
(init_hyphen_requests): Update call site.
(add_hyphenation_exceptions): Make error diagnostic more helpful.
---
ChangeLog | 11 +++++++++++
src/roff/troff/env.cpp | 7 ++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 51d11b2eb..3904e9c81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-11-03 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/env.cpp: Clarify diagnostic and trivially
+ refactor.
+ (hyphen_word): Rename this...
+ (add_hyphenation_exceptions): ...to this.
+ (init_hyphen_requests): Update call site.
+
+ (add_hyphenation_exceptions): Make error diagnostic more
+ helpful.
+
2023-11-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp: Add diagnostic and trivially refactor.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 0509f6423..39d502f47 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3617,10 +3617,11 @@ static void select_hyphenation_language()
const int WORD_MAX = 256; // we use unsigned char for offsets in
// hyphenation exceptions
-static void hyphen_word()
+static void add_hyphenation_exceptions()
{
if (!current_language) {
- error("no current hyphenation language");
+ error("cannot add hyphenation exceptions when no hyphenation"
+ " language is set");
skip_line();
return;
}
@@ -4157,7 +4158,7 @@ const char *hyphenation_language_reg::get_string()
void init_hyphen_requests()
{
- init_request("hw", hyphen_word);
+ init_request("hw", add_hyphenation_exceptions);
init_request("hla", select_hyphenation_language);
init_request("hpf", hyphenation_patterns_file);
init_request("hpfa", hyphenation_patterns_file_append);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 18/25: [troff]: Trivially refactor (`hw` request).,
G. Branden Robinson <=