gbranden pushed a commit to branch master
in repository groff.
commit 8ee03cb86f218260ca577a5a7fdfa04cca1a7cad
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 13 12:41:35 2026 -0500
[troff]: Trivially refactor (7/10).
* src/roff/troff/node.h: Rename declaration of `get_underline_fontno()`
to `get_selected_underline_font_mounting_position()`.
* src/roff/troff/env.cpp (get_underline_fontno): Rename this...
(get_selected_underline_font_mounting_position): ...to this.
* src/roff/troff/env.cpp (environment::set_font)
(configure_underlining): Update call sites.
---
ChangeLog | 8 ++++++++
src/roff/troff/env.cpp | 6 +++---
src/roff/troff/node.cpp | 2 +-
src/roff/troff/node.h | 2 +-
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1f27f5b02..c97646d89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -73,6 +73,14 @@
(init_node_requests): Update wire-uppery of request handler to
its name in the formatter.
+ * src/roff/troff/node.h: Rename declaration of
+ `get_underline_fontno()` to
+ `get_selected_underline_font_mounting_position()`.
+ * src/roff/troff/env.cpp (get_underline_fontno): Rename this...
+ (get_selected_underline_font_mounting_position): ...to this.
+ * src/roff/troff/env.cpp (environment::set_font)
+ (configure_underlining): Update call sites.
+
2026-04-13 G. Branden Robinson <[email protected]>
* src/roff/troff/node.cpp: Refactor. Take one of
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6d0fa03da..32fc175a8 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -653,9 +653,9 @@ bool environment::set_font(symbol nm)
fontno = n;
}
if (underline_spaces && fontno != prev_fontno) {
- if (fontno == get_underline_fontno())
+ if (fontno == get_selected_underline_font_mounting_position())
add_node(configure_space_underlining(true));
- if (prev_fontno == get_underline_fontno())
+ if (prev_fontno == get_selected_underline_font_mounting_position())
add_node(configure_space_underlining(false));
}
return true;
@@ -1729,7 +1729,7 @@ void configure_underlining(bool want_spaces_underlined)
else {
curenv->underlined_line_count = n;
curenv->pre_underline_fontno = curenv->fontno;
- curenv->fontno = get_underline_fontno();
+ curenv->fontno = get_selected_underline_font_mounting_position();
if (want_spaces_underlined) {
curenv->underline_spaces = true;
curenv->add_node(configure_space_underlining(true));
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 7c0b2f2b3..ca774f57c 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7047,7 +7047,7 @@ static void select_underline_font_request() // .uf
skip_line();
}
-int get_underline_fontno()
+int get_selected_underline_font_mounting_position()
{
return underline_fontno;
}
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 6aa47ef68..a52842d04 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -712,7 +712,7 @@ extern bool is_valid_font(int);
extern int mounting_position_of_font(symbol);
extern int next_available_font_mounting_position();
extern void init_size_list(int *);
-extern int get_underline_fontno();
+extern int get_selected_underline_font_mounting_position();
class output_file {
char make_g_plus_plus_shut_up;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit