[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Mon, 11 Mar 2024 19:02:18 -0400 (EDT) |
branch: master
commit b1f1ce798848f20690b6c575df260f6a446cb7d1
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Mar 11 23:54:27 2024 +0100
* tp/t/test_utils.pl (test): collect
Texinfo::Config::GNUT_initialize_config init files customization
variables information return value and use it in converter options.
* tp/t/init_files_tests.t (redefined_buttons_functions),
t/init/redefined_buttons.pm, tp/Makefile.am (test_files),
tp/Makefile.tres: add a test of redefinition of button formatting
functions in init file.
---
ChangeLog | 11 +
tp/Makefile.am | 1 +
tp/Makefile.tres | 2 +
tp/t/init/redefined_buttons.pm | 57 ++
tp/t/init_files_tests.t | 4 +
.../redefined_buttons_functions.pl | 740 +++++++++++++++++++++
.../redefined_buttons_functions/res_html/chap.html | 42 ++
.../res_html/chap2.html | 46 ++
.../res_html/index.html | 49 ++
.../redefined_buttons_functions/res_html/sec1.html | 41 ++
.../redefined_buttons_functions/res_html/sec2.html | 42 ++
.../redefined_buttons_functions/res_html/sec3.html | 40 ++
tp/t/test_utils.pl | 7 +-
13 files changed, 1080 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b18568ca9f..fc25df9786 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-03-11 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/test_utils.pl (test): collect
+ Texinfo::Config::GNUT_initialize_config init files customization
+ variables information return value and use it in converter options.
+
+ * tp/t/init_files_tests.t (redefined_buttons_functions),
+ t/init/redefined_buttons.pm, tp/Makefile.am (test_files),
+ tp/Makefile.tres: add a test of redefinition of button formatting
+ functions in init file.
+
2024-03-11 Patrice Dumas <pertusus@free.fr>
* Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
diff --git a/tp/Makefile.am b/tp/Makefile.am
index 5d760400bd..d8a8900ba3 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -185,6 +185,7 @@ test_files = \
t/init/misc_file_collision.init \
t/init/only_toc_out.init \
t/init/redefine_need.init \
+ t/init/redefined_buttons.pm \
t/init/redirection_file_collision_with_special.init \
t/init/redirection_file_collision_with_user_def.init \
t/init/set_unit_file_name_filepath.pm \
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 84a7d39b08..a7f5f621e2 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1040,6 +1040,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/init_files_tests/documentation_examples/res_html \
t/results/init_files_tests/macro_defined_txiinternalvalue_in_translation.pl \
t/results/init_files_tests/modified_translation.pl \
+ t/results/init_files_tests/redefined_buttons_functions.pl \
+ t/results/init_files_tests/redefined_buttons_functions/res_html \
t/results/init_files_tests/redefined_need.pl \
t/results/init_files_tests/sc_formatting_with_css.pl \
t/results/init_files_tests/sc_formatting_with_css/res_html \
diff --git a/tp/t/init/redefined_buttons.pm b/tp/t/init/redefined_buttons.pm
new file mode 100644
index 0000000000..370062a970
--- /dev/null
+++ b/tp/t/init/redefined_buttons.pm
@@ -0,0 +1,57 @@
+
+use strict;
+
+sub _redefined_buttons_button_dynamic_direction($$$)
+{
+ my $self = shift;
+ my $direction = shift;
+ my $source_command = shift;
+
+ my $result = undef;
+
+ my $href = $self->from_element_direction($direction, 'href',
+ undef, undef, $source_command);
+
+ my $node = $self->from_element_direction($direction, 'section');
+
+ if (!defined($node)) {
+ $node = $self->from_element_direction($direction, 'node');
+ }
+
+ if (defined($node) and $node =~ /\S/) {
+ my $hyperlink;
+ if (defined($href) and $href ne '') {
+ my $href_attributes = '';
+ if ($self->get_conf('USE_ACCESSKEY')) {
+ my $accesskey = $self->direction_string($direction, 'accesskey',
'string');
+ if (defined($accesskey) and ($accesskey ne '')) {
+ $href_attributes = " accesskey=\"$accesskey\"";
+ }
+ }
+ if ($self->get_conf('USE_REL_REV')) {
+ my $button_rel = $self->direction_string($direction, 'rel', 'string');
+ if (defined($button_rel) and ($button_rel ne '')) {
+ $href_attributes .= " rel=\"$button_rel\"";
+ }
+ }
+ $hyperlink = "<a href=\"$href\"${href_attributes}>$node</a>";
+ } else {
+ $hyperlink = $node;
+ }
+ $result = "TO ".uc($direction)." -> $hyperlink";
+ }
+ # 1 to communicate that a delimiter is needed for that button
+ return ($result, 1);
+}
+
+my @SECTION_BUTTONS = (['Next', \&_redefined_buttons_button_dynamic_direction],
+ ['Prev',
+ \&Texinfo::Convert::HTML::_default_panel_button_dynamic_direction
],
+ ['Up', \&_redefined_buttons_button_dynamic_direction],
+ ['Forward', \&_redefined_buttons_button_dynamic_direction]);
+
+texinfo_set_from_init_file ('SECTION_BUTTONS', \@SECTION_BUTTONS);
+
+texinfo_set_from_init_file ('NODE_FOOTER_BUTTONS', \@SECTION_BUTTONS);
+
+1;
diff --git a/tp/t/init_files_tests.t b/tp/t/init_files_tests.t
index c319e5d0ad..ea54448cf0 100644
--- a/tp/t/init_files_tests.t
+++ b/tp/t/init_files_tests.t
@@ -186,6 +186,10 @@ $direction_strings_test_text,
{'init_files' => ['directions_string_undef.pm']},
{'TEXI2HTML' => 1},
],
+['redefined_buttons_functions',
+$direction_strings_test_text,
+{'init_files' => ['redefined_buttons.pm']},
+],
);
foreach my $test (@test_cases) {
diff --git a/tp/t/results/init_files_tests/redefined_buttons_functions.pl
b/tp/t/results/init_files_tests/redefined_buttons_functions.pl
new file mode 100644
index 0000000000..4524098ad2
--- /dev/null
+++ b/tp/t/results/init_files_tests/redefined_buttons_functions.pl
@@ -0,0 +1,740 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'redefined_buttons_functions'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 2
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chap'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 5
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chap2'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chap2'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap 2'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '2'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 8
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'sec1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'sec1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 10
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Sec 1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'section',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '2.1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 11
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'sec2'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'sec2'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 13
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Sec 2'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'section',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '2.2'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 14
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'sec3'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'sec3'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 16
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Sec 3'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'section_number' => '2.3'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 17
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'redefined_buttons_functions'} = '@node Top
+@top top
+
+@node chap
+@chapter Chap
+
+@node chap2
+@chapter Chap 2
+
+@node sec1
+@section Sec 1
+
+@node sec2
+@section Sec 2
+
+@node sec3
+@section Sec 3
+';
+
+
+$result_texts{'redefined_buttons_functions'} = 'top
+***
+
+1 Chap
+******
+
+2 Chap 2
+********
+
+2.1 Sec 1
+=========
+
+2.2 Sec 2
+=========
+
+2.3 Sec 3
+=========
+';
+
+$result_sectioning{'redefined_buttons_functions'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chap'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '1',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ },
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chap2'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'sec1'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 2,
+ 'section_number' => '2.1'
+ }
+ },
+ {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'sec2'
+ }
+ },
+ 'section_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'section_level' => 2,
+ 'section_number' => '2.2'
+ }
+ },
+ {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'sec3'
+ }
+ },
+ 'section_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'section_level' => 2,
+ 'section_number' => '2.3'
+ }
+ }
+ ],
+ 'section_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '2',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'sectioning_root' => {},
+ 'toplevel_directions' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[1]{'extra'}{'section_directions'}{'prev'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[1]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[2]{'extra'}{'section_directions'}{'prev'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[1];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_childs'}[2]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_directions'}{'prev'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[1]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'redefined_buttons_functions'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'redefined_buttons_functions'};
+
+$result_nodes{'redefined_buttons_functions'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ }
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '2'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chap2'
+ }
+ },
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chap'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {},
+ {},
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'section_number' => '2.1'
+ }
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'section_number' => '2.2'
+ }
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'section',
+ 'extra' => {
+ 'section_number' => '2.3'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'sec3'
+ }
+ },
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'sec2'
+ }
+ },
+ 'up' => {}
+ },
+ 'normalized' => 'sec1'
+ }
+ },
+ {},
+ {}
+];
+$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
=
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'redefined_buttons_functions'}[0];
+$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'redefined_buttons_functions'}[0];
+$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'redefined_buttons_functions'}[0];
+$result_nodes{'redefined_buttons_functions'}[1] =
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[2] =
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
=
$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
=
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'redefined_buttons_functions'}[3];
+$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
=
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'up'}
=
$result_nodes{'redefined_buttons_functions'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[4] =
$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'};
+$result_nodes{'redefined_buttons_functions'}[5] =
$result_nodes{'redefined_buttons_functions'}[3]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'redefined_buttons_functions'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chap'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chap2'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'sec1'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'sec2'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'sec3'
+ }
+ }
+];
+
+$result_errors{'redefined_buttons_functions'} = [];
+
+
+$result_floats{'redefined_buttons_functions'} = {};
+
+
+1;
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap.html
new file mode 100644
index 0000000000..a82fa7a5e7
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>chap (top)</title>
+
+<meta name="description" content="chap (top)">
+<meta name="keywords" content="chap (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="index.html" rel="up" title="Top">
+<link href="chap2.html" rel="next" title="chap2">
+<link href="index.html" rel="prev" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+TO NEXT -> <a href="chap2.html" accesskey="n" rel="next">Chap 2</a>, Previous:
<a href="index.html" accesskey="p" rel="prev">top</a>, TO UP -> <a
href="index.html" accesskey="u" rel="up">top</a>, TO FORWARD -> <a
href="chap2.html" accesskey="n" rel="next">Chap 2</a></p>
+</div>
+<hr>
+<h2 class="chapter" id="Chap"><span>1 Chap<a class="copiable-link"
href="#Chap"> ¶</a></span></h2>
+
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap2.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap2.html
new file mode 100644
index 0000000000..224f847bef
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/chap2.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>chap2 (top)</title>
+
+<meta name="description" content="chap2 (top)">
+<meta name="keywords" content="chap2 (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="index.html" rel="up" title="Top">
+<link href="chap.html" rel="prev" title="chap">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="chap2">
+<div class="nav-panel">
+<p>
+Previous: <a href="chap.html" accesskey="p" rel="prev">Chap</a>, TO UP -> <a
href="index.html" accesskey="u" rel="up">top</a>, TO FORWARD -> <a
href="sec1.html" accesskey="n" rel="next">Sec 1</a></p>
+</div>
+<hr>
+<h2 class="chapter" id="Chap-2"><span>2 Chap 2<a class="copiable-link"
href="#Chap-2"> ¶</a></span></h2>
+
+<ul class="mini-toc">
+<li><a href="sec1.html" accesskey="1">Sec 1</a></li>
+<li><a href="sec2.html" accesskey="2">Sec 2</a></li>
+<li><a href="sec3.html" accesskey="3">Sec 3</a></li>
+</ul>
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/index.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/index.html
new file mode 100644
index 0000000000..b2207dcdaf
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/index.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Top (top)</title>
+
+<meta name="description" content="Top (top)">
+<meta name="keywords" content="Top (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="chap.html" rel="next" title="chap">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="chap.html" accesskey="n" rel="next">Chap</a> </p>
+</div>
+<hr>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="chap.html" accesskey="1">Chap</a></li>
+<li><a href="chap2.html" accesskey="2">Chap 2</a></li>
+</ul>
+</div>
+<hr>
+<div class="nav-panel">
+<p>
+Next: <a href="chap.html" accesskey="n" rel="next">Chap</a> </p>
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec1.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec1.html
new file mode 100644
index 0000000000..394b52ddc8
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>sec1 (top)</title>
+
+<meta name="description" content="sec1 (top)">
+<meta name="keywords" content="sec1 (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="chap2.html" rel="up" title="chap2">
+<link href="sec2.html" rel="next" title="sec2">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="section-level-extent" id="sec1">
+<div class="nav-panel">
+<p>
+TO NEXT -> <a href="sec2.html" accesskey="n" rel="next">Sec 2</a>, TO UP -> <a
href="chap2.html" accesskey="u" rel="up">Chap 2</a>, TO FORWARD -> <a
href="sec2.html" accesskey="n" rel="next">Sec 2</a></p>
+</div>
+<hr>
+<h3 class="section" id="Sec-1"><span>2.1 Sec 1<a class="copiable-link"
href="#Sec-1"> ¶</a></span></h3>
+
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec2.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec2.html
new file mode 100644
index 0000000000..1ac9349690
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>sec2 (top)</title>
+
+<meta name="description" content="sec2 (top)">
+<meta name="keywords" content="sec2 (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="chap2.html" rel="up" title="chap2">
+<link href="sec3.html" rel="next" title="sec3">
+<link href="sec1.html" rel="prev" title="sec1">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="section-level-extent" id="sec2">
+<div class="nav-panel">
+<p>
+TO NEXT -> <a href="sec3.html" accesskey="n" rel="next">Sec 3</a>, Previous:
<a href="sec1.html" accesskey="p" rel="prev">Sec 1</a>, TO UP -> <a
href="chap2.html" accesskey="u" rel="up">Chap 2</a>, TO FORWARD -> <a
href="sec3.html" accesskey="n" rel="next">Sec 3</a></p>
+</div>
+<hr>
+<h3 class="section" id="Sec-2"><span>2.2 Sec 2<a class="copiable-link"
href="#Sec-2"> ¶</a></span></h3>
+
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec3.html
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec3.html
new file mode 100644
index 0000000000..c9d4f60822
--- /dev/null
+++
b/tp/t/results/init_files_tests/redefined_buttons_functions/res_html/sec3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>sec3 (top)</title>
+
+<meta name="description" content="sec3 (top)">
+<meta name="keywords" content="sec3 (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="chap2.html" rel="up" title="chap2">
+<link href="sec2.html" rel="prev" title="sec2">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="section-level-extent" id="sec3">
+<div class="nav-panel">
+<p>
+Previous: <a href="sec2.html" accesskey="p" rel="prev">Sec 2</a>, TO UP -> <a
href="chap2.html" accesskey="u" rel="up">Chap 2</a></p>
+</div>
+<hr>
+<h3 class="section" id="Sec-3"><span>2.3 Sec 3<a class="copiable-link"
href="#Sec-3"> ¶</a></span></h3>
+</div>
+
+
+
+</body>
+</html>
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index a5ac8a1a10..20761204e0 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -975,6 +975,7 @@ sub test($$)
# reset Texinfo::Config informations to have isolated tests
Texinfo::Config::GNUT_reinitialize_init_files();
+ my $init_files_options = {};
my $init_file_directories = [$srcdir.'init/', $srcdir.'t/init/'];
# the init file names are supposed to be binary strings. Since they
# are not encoded anywhere, probably only non ascii file names should
@@ -986,7 +987,8 @@ sub test($$)
$conf->{'COMMAND_LINE_ENCODING'} = $locale_encoding;
$conf->{'MESSAGE_ENCODING'} = $locale_encoding;
}
- Texinfo::Config::GNUT_initialize_config('', $conf, {});
+ $init_files_options
+ = Texinfo::Config::GNUT_initialize_config('', $conf, {});
foreach my $filename (@{$parser_options->{'init_files'}}) {
my $file = Texinfo::Common::locate_init_file($filename,
$init_file_directories, 0);
@@ -1205,7 +1207,8 @@ sub test($$)
foreach my $format (@tested_formats) {
if (defined($formats{$format})) {
- my $format_converter_options = {%$converter_options};
+ my $format_converter_options = {%$converter_options,
+ %$init_files_options};
my $format_type = $format;
if ($format_type =~ s/^file_//) {
# the information that the results is a file is passed