gbranden pushed a commit to branch master
in repository groff.

commit 1a1abf0b271e4b17f39b990ae4e29893bd9f4b68
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 13 12:58:53 2026 -0500

    [troff]: Trivially refactor (9/10).
    
    * src/roff/troff/env.h (class environment): Rename declaration of
      `set_font()` to `select_font()`.
    
    * src/roff/troff/env.cpp (environment::set_font): Rename these
      overloaded names...
      (environment::select_font): ...to these.
    
      (select_font): Update call site.
---
 ChangeLog              |  7 +++++++
 src/roff/troff/env.cpp | 12 ++++++------
 src/roff/troff/env.h   |  4 ++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3adad3036..7bde10188 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,13 @@
        (assign_font_and_file_name_to_mounting_position)
        (mount_style): Update call sites.
 
+       * src/roff/troff/env.h (class environment): Rename declaration
+       of `set_font()` to `select_font()`.
+       * src/roff/troff/env.cpp (environment::set_font): Rename
+       these overloaded names...
+       (environment::select_font): ...to these.
+       (select_font): Update call site.
+
 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 32fc175a8..c21ca4871 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -626,7 +626,7 @@ static void warn_if_font_name_deprecated(symbol nm)
   }
 }
 
-bool environment::set_font(symbol nm)
+bool environment::select_font(symbol nm)
 {
   if (was_line_interrupted)
     return false;
@@ -661,7 +661,7 @@ bool environment::set_font(symbol nm)
   return true;
 }
 
-bool environment::set_font(int n)
+bool environment::select_font(int n)
 {
   if (was_line_interrupted)
     return false;
@@ -1349,8 +1349,8 @@ void select_font(symbol s)
        break;
       }
   }
-  // environment::set_font warns if an unused mounting position is
-  // requested.  We must warn here if a bogus font name is selected.
+  // `environment::select_font()` warns if an unused mounting position
+  // is requested.  We must warn here if a bogus font name is selected.
   if (is_number) {
     errno = 0;
     long val = strtol(s.contents(), NULL, 10);
@@ -1358,12 +1358,12 @@ void select_font(symbol s)
       warning(WARN_RANGE, "font mounting position must be in range"
              " 0..%1, got %2", INT_MAX, s.contents());
     else
-      (void) curenv->set_font(int(val));
+      (void) curenv->select_font(int(val));
   }
   else {
     if (s == "DESC")
       error("'%1' is not a valid font name", s.contents());
-    else if (!curenv->set_font(s))
+    else if (!curenv->select_font(s))
       warning(WARN_FONT, "cannot select font '%1'", s.contents());
   }
 }
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 4cfb0c44b..a4cd518f4 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -353,8 +353,8 @@ public:
   node *extract_output_line();
   void width_registers();
   void wrap_up_tab();
-  bool set_font(int);
-  bool set_font(symbol);
+  bool select_font(int);
+  bool select_font(symbol);
   void set_family(symbol);
   void set_size(int);
   void set_char_height(int);

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to