gbranden pushed a commit to branch master
in repository groff.
commit 5b81a3df9df81df683bc3ec5a1a20109117b3087
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 13 10:11:14 2026 -0500
[troff]: Trivially refactor (2/10).
Rename function to better align with terminology used in our
documentation.
* src/roff/troff/node.h: Rename declaration of
`next_available_font_position()` to
`next_available_font_mounting_position()`. Yes, it's a mouthful, but
the term "position" can apply to many things: the drawing position, an
index into an array, and so forth.
* src/roff/troff/node.cpp (next_available_font_position): Rename this...
(next_available_font_mounting_position): ...to this.
* src/roff/troff/env.cpp (environment::set_font):
* src/roff/troff/node.cpp
(assign_font_and_file_name_to_mounting_position)
(font_family::resolve, read_font_identifier, zoom_font_request)
(next_available_font_position_reg): Update call sites.
---
ChangeLog | 16 +++++++++++++++-
src/roff/troff/env.cpp | 2 +-
src/roff/troff/node.cpp | 12 ++++++------
src/roff/troff/node.h | 2 +-
4 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fe87408f9..99a4227b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
2026-04-13 G. Branden Robinson <[email protected]>
- [troff]: Trivially refactor. Rename function to better align
+ [troff]: Trivially refactor. Rename functions to better align
with terminology used in our documentation.
* src/roff/troff/node.h: Rename declaration of `symbol_fontno()`
@@ -13,6 +13,20 @@
* src/roff/troff/node.cpp (is_abstract_style)
(font_family::resolve, read_font_identifier): Update call sites.
+ * src/roff/troff/node.h: Rename declaration of
+ `next_available_font_position()` to
+ `next_available_font_mounting_position()`. Yes, it's a
+ mouthful, but the term "position" can apply to many things: the
+ drawing position, an index into an array, and so forth.
+ * src/roff/troff/node.cpp (next_available_font_position): Rename
+ this...
+ (next_available_font_mounting_position): ...to this.
+ * src/roff/troff/env.cpp (environment::set_font):
+ * src/roff/troff/node.cpp
+ (assign_font_and_file_name_to_mounting_position)
+ (font_family::resolve, read_font_identifier, zoom_font_request)
+ (next_available_font_position_reg): 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 e59c5d14f..351aec75c 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -644,7 +644,7 @@ bool environment::set_font(symbol nm)
prev_fontno = fontno;
int n = mounting_position_of_font(nm);
if (n < 0) {
- n = next_available_font_position();
+ n = next_available_font_mounting_position();
if (!mount_font(n, nm))
return false;
}
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 00dadcd45..ff2f9f2fc 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6691,7 +6691,7 @@ static bool
assign_font_and_file_name_to_mounting_position(
if ((n - font_table_size) > 1000) {
error("requested font mounting position %1 too much larger than"
" first unused position %2", n,
- next_available_font_position());
+ next_available_font_mounting_position());
return false;
}
grow_font_table(n);
@@ -6910,7 +6910,7 @@ int font_family::resolve(int mounting_position)
&& !font_table[n]->is_style())
break;
if (n >= font_table_size) {
- n = next_available_font_position();
+ n = next_available_font_mounting_position();
if (!assign_font_and_file_name_to_mounting_position(f, f, n))
return FONT_NOT_MOUNTED;
}
@@ -7011,7 +7011,7 @@ static bool read_font_identifier(font_lookup_info *finfo)
if (!s.is_null()) {
n = mounting_position_of_font(s);
if (n < 0) {
- n = next_available_font_position();
+ n = next_available_font_mounting_position();
if (mount_font(n, s))
finfo->position = n;
}
@@ -7182,7 +7182,7 @@ static void zoom_font_request() // .fzoom
skip_line();
return;
}
- int fpos = next_available_font_position();
+ int fpos = next_available_font_mounting_position();
if (!(mount_font(fpos, font_name))) {
error("cannot mount font '%1' to set a zoom factor for it",
font_name.contents());
@@ -7220,7 +7220,7 @@ static void zoom_font_request() // .fzoom
skip_line();
}
-int next_available_font_position()
+int next_available_font_mounting_position()
{
int i;
for (i = 1;
@@ -7573,7 +7573,7 @@ public:
const char *next_available_font_position_reg::get_string()
{
- return i_to_a(next_available_font_position());
+ return i_to_a(next_available_font_mounting_position());
}
class printing_reg : public reg {
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index cee9f73ee..924112723 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -710,7 +710,7 @@ extern bool mount_style(int, symbol);
extern bool is_valid_font_mounting_position(int);
extern bool is_valid_font(int);
extern int mounting_position_of_font(symbol);
-extern int next_available_font_position();
+extern int next_available_font_mounting_position();
extern void init_size_list(int *);
extern int get_underline_fontno();
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit