gbranden pushed a commit to branch master in repository groff. commit 60f9768db265468334ee50740f74a922787f97c5 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Jul 12 17:01:46 2025 -0500
[troff]: Trivially refactor. ...continuing naming reform of functions that are troff request handlers and which lists of objects or properties thereof. Revert to using `print` for {debugging} request handlers, and reserve `dump` for member functions of classes. (One might use the latter from within GDB, for example.) * src/roff/troff/env.cpp: (dump_environment_request): Rename this... (print_environment_request): ...to this... (dump_pending_output_line_request): ...and this... (print_pending_output_line_request): ...to this. (init_env_requests): Update request handler setup. * src/roff/troff/node.cpp: (dump_font_mounting_positions_request): Rename this... (print_font_mounting_position_request): ...to this... (dump_font_translations): ...and this... (print_font_translation_request): ...to this. (init_node_requests): Update request handler setup. * src/roff/troff/reg.cpp: (dump_register_request): Rename this... (print_register_request): ...to this. (init_reg_requests): Update request handler setup. --- ChangeLog | 26 ++++++++++++++++++++++++-- src/roff/troff/env.cpp | 8 ++++---- src/roff/troff/input.cpp | 20 ++++++++++---------- src/roff/troff/node.cpp | 8 ++++---- src/roff/troff/reg.cpp | 4 ++-- 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30af0dd9f..90ebb62db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,34 @@ 2025-07-14 G. Branden Robinson <g.branden.robin...@gmail.com> - * src/roff/troff/input.cpp: Trivially refactor, continuing - naming reform of functions that are troff request handlers. + [troff]: Trivially refactor, continuing naming reform of + functions that are troff request handlers and which lists of + objects or properties thereof. Revert to using `print` for + {debugging} request handlers, and reserve `dump` for member + functions of classes. (One might use the latter from within + GDB, for example.) + + * src/roff/troff/env.cpp: + (dump_environment_request): Rename this... + (print_environment_request): ...to this... + (dump_pending_output_line_request): ...and this... + (print_pending_output_line_request): ...to this. + (init_env_requests): Update request handler setup. + * src/roff/troff/input.cpp: (set_character_flags): Rename this... (set_character_flags_request): ...to this... (warn_request): ...and this... (set_warning_mask_request): ...to this. (init_input_requests): Update request handler setup. + * src/roff/troff/node.cpp: + (dump_font_mounting_positions_request): Rename this... + (print_font_mounting_position_request): ...to this... + (dump_font_translations): ...and this... + (print_font_translation_request): ...to this. + (init_node_requests): Update request handler setup. + * src/roff/troff/reg.cpp: + (dump_register_request): Rename this... + (print_register_request): ...to this. + (init_reg_requests): Update request handler setup. 2025-07-12 G. Branden Robinson <g.branden.robin...@gmail.com> diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index afcf0a1a4..05119e229 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -3641,7 +3641,7 @@ void environment::dump() fflush(stderr); } -void dump_environment_request() +void print_environment_request() { errprint("Current Environment:\n"); curenv->dump(); @@ -3660,7 +3660,7 @@ void dump_environment_request() skip_line(); } -static void dump_pending_output_line_request() +static void print_pending_output_line_request() { curenv->dump_pending_nodes(); skip_line(); @@ -4327,8 +4327,8 @@ void init_env_requests() init_request("nh", no_hyphenate); init_request("nm", number_lines); init_request("nn", no_number); - init_request("pev", dump_environment_request); - init_request("pline", dump_pending_output_line_request); + init_request("pev", print_environment_request); + init_request("pline", print_pending_output_line_request); init_request("ps", point_size); init_request("pvs", post_vertical_spacing); init_request("rj", right_justify); diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index 798ac6e45..adc6acecb 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -1577,7 +1577,7 @@ static void define_color() skip_line(); } -static void report_color() +static void print_color_request() { symbol key; color *value; @@ -3772,7 +3772,7 @@ void macro_header::json_dump_macro() fflush(stderr); } -void print_macros() +void print_macro_request() { request_or_macro *rm; macro *m = 0 /* nullptr */; @@ -4450,7 +4450,7 @@ static symbol composite_glyph_name(symbol nm) return symbol(gl.contents()); } -static void report_composite_characters() +static void print_composite_character_request() { dictionary_iterator iter(composite_dictionary); symbol key; @@ -4750,7 +4750,7 @@ static void define_special_character_request() define_character(CHAR_SPECIAL_FALLBACK); } -static void report_character_request() +static void print_character_request() { if (!has_arg()) { warning(WARN_MISSING, "character report request expects arguments"); @@ -7631,7 +7631,7 @@ grostream::~grostream() object_dictionary stream_dictionary(20); -static void print_streams() +static void print_stream_request() { object_dictionary_iterator iter(stream_dictionary); symbol stream_name; @@ -9580,14 +9580,14 @@ void init_input_requests() init_request("opena", opena_request); init_request("output", output_request); init_request("pc", page_character_request); - init_request("pchar", report_character_request); - init_request("pcolor", report_color); - init_request("pcomposite", report_composite_characters); + init_request("pchar", print_character_request); + init_request("pcolor", print_color_request); + init_request("pcomposite", print_composite_character_request); init_request("pi", pipe_output); - init_request("pm", print_macros); + init_request("pm", print_macro_request); init_request("psbb", ps_bbox_request); init_request("pso", pipe_source_request); - init_request("pstream", print_streams); + init_request("pstream", print_stream_request); init_request("rchar", remove_character); init_request("rd", read_request); init_request("return", return_macro_request); diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp index 7ab47a47e..952d5ba85 100644 --- a/src/roff/troff/node.cpp +++ b/src/roff/troff/node.cpp @@ -6545,7 +6545,7 @@ static bool mount_font_no_translate(int n, symbol name, symbol filename, return true; } -void dump_font_mounting_positions_request() +void print_font_mounting_position_request() { for (int i = 0; i < font_table_size; i++) { font_info *fi = font_table[i]; @@ -6642,7 +6642,7 @@ static void translate_font() skip_line(); } -static void dump_font_translations() +static void print_font_translation_request() { dictionary_iterator iter(font_translation_dictionary); symbol from, to; @@ -7399,8 +7399,8 @@ void init_node_requests() init_request("ftr", translate_font); init_request("kern", set_kerning_mode); init_request("lg", set_ligature_mode); - init_request("pfp", dump_font_mounting_positions_request); - init_request("pftr", dump_font_translations); + init_request("pfp", print_font_mounting_position_request); + init_request("pftr", print_font_translation_request); init_request("rfschar", remove_font_specific_character); init_request("shc", soft_hyphen_character_request); init_request("special", set_special_fonts); diff --git a/src/roff/troff/reg.cpp b/src/roff/troff/reg.cpp index f8f39af53..f6b0d1865 100644 --- a/src/roff/troff/reg.cpp +++ b/src/roff/troff/reg.cpp @@ -563,7 +563,7 @@ static void dump_register(symbol *id, reg *r) errprint("\n"); } -void dump_register_request() +void print_register_request() { reg *r; symbol identifier; @@ -595,7 +595,7 @@ void init_reg_requests() init_request("af", assign_register_format_request); init_request("aln", alias_register_request); init_request("rnn", rename_register_request); - init_request("pnr", dump_register_request); + init_request("pnr", print_register_request); } // Local Variables: _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit