texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/texi2any.pl: set documentlanguage in main pr


From: Patrice Dumas
Subject: branch master updated: * tp/texi2any.pl: set documentlanguage in main program configuration as it is needed for regenerate_master_menu.
Date: Sat, 15 Jan 2022 17:55:17 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 08cf8833d2 * tp/texi2any.pl: set documentlanguage in main program 
configuration as it is needed for regenerate_master_menu.
08cf8833d2 is described below

commit 08cf8833d2dd3489261f0a5be250b65b65e1db91
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 15 23:55:06 2022 +0100

    * tp/texi2any.pl: set documentlanguage in main program configuration
    as it is needed for regenerate_master_menu.
    
    * tp/Texinfo/Config.pm (new, get_conf, set_conf): reset the additional
    configuration each time new is called.  Add a flat to the
    configuration to distinguish the standalone configuration as used
    in the tests or the configuration for the main program.  For the main
    program do not override command line.
    
    * tp/Texinfo/Transformations.pm: mark the translation especially.
    
    * .gitignore, tp/tests/Makefile.am,
    tp/tests/many_input_files/Makefile.am: add new tests for many_input_files.
---
 .gitignore                                         |   2 +
 ChangeLog                                          |  16 +++
 man/pod2texi.1                                     |   2 +-
 tp/Texinfo/Config.pm                               |  37 +++--
 tp/Texinfo/ParserNonXS.pm                          |   4 +-
 tp/Texinfo/Transformations.pm                      |   7 +
 tp/maintain/all_tests.sh                           |   4 +-
 tp/tests/Makefile.am                               |   1 +
 tp/tests/many_input_files/Makefile.am              |  28 +++-
 tp/tests/many_input_files/different_encodings.sh   |  71 ++++++++++
 .../char_latin1_latin1_in_refs.html                | 153 +++++++++++++++++++++
 .../char_latin1_utf8_in_refs.html                  | 153 +++++++++++++++++++++
 .../different_encodings_res/different_encodings.2  |   0
 .../stdout_different_encodings.out                 |   0
 .../different_languages_gen_master_menu.sh         |  71 ++++++++++
 .../different_languages_gen_master_menu.2          |   0
 .../no_master_menu_fr.html                         |  75 ++++++++++
 .../no_master_menu_no_documentlanguage.html        |  74 ++++++++++
 .../stdout_different_languages_gen_master_menu.out |   0
 .../input_files/no_master_menu_fr.texi             |  20 +++
 .../no_master_menu_no_documentlanguage.texi        |  18 +++
 .../input_files/no_master_menu_pt.texi             |  20 +++
 tp/texi2any.pl                                     |  24 +++-
 23 files changed, 754 insertions(+), 26 deletions(-)

diff --git a/.gitignore b/.gitignore
index 459c63668f..2e840cd46d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -204,6 +204,8 @@ tp/tests/t/*.trs
 tp/tests/test_scripts/*.log
 tp/tests/test_scripts/*.trs
 
+tp/tests/many_input_files/different_encodings
+tp/tests/many_input_files/different_languages_gen_master_menu
 tp/tests/many_input_files/tex_l2h
 tp/tests/many_input_files/tex_t4ht
 tp/tests/many_input_files/raw_out
diff --git a/ChangeLog b/ChangeLog
index e843e00dc2..5ea2ffd682 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2022-01-15  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/texi2any.pl: set documentlanguage in main program configuration
+       as it is needed for regenerate_master_menu.
+
+       * tp/Texinfo/Config.pm (new, get_conf, set_conf): reset the additional
+       configuration each time new is called.  Add a flat to the
+       configuration to distinguish the standalone configuration as used
+       in the tests or the configuration for the main program.  For the main
+       program do not override command line.
+
+       * tp/Texinfo/Transformations.pm: mark the translation especially.
+
+       * .gitignore, tp/tests/Makefile.am,
+       tp/tests/many_input_files/Makefile.am: add new tests for 
many_input_files.
+
 2022-01-15  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm (%default_index_commands, %command_index),
diff --git a/man/pod2texi.1 b/man/pod2texi.1
index 13816f13f2..e0a543d043 100644
--- a/man/pod2texi.1
+++ b/man/pod2texi.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "POD2TEXI 1"
-.TH POD2TEXI 1 "2022-01-01" "perl v5.32.1" "User Contributed Perl 
Documentation"
+.TH POD2TEXI 1 "2022-01-14" "perl v5.32.1" "User Contributed Perl 
Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/tp/Texinfo/Config.pm b/tp/Texinfo/Config.pm
index eb07d24e0e..0bda86968d 100644
--- a/tp/Texinfo/Config.pm
+++ b/tp/Texinfo/Config.pm
@@ -484,22 +484,19 @@ sub GNUT_get_style_command_formatting($;$)
 # reference argument.
 package Texinfo::MainConfig;
 
-
-my $additional_conf = {};
-
 sub new(;$)
 {
   my $options = shift;
+  my $config;
   if (defined($options)) {
     # creates a new object based on input hash reference
-    %$additional_conf = %$options;
-    bless $additional_conf;
-    return $additional_conf;
+    $config = {'standalone' => 1, 'config' => {%$options}};
   } else {
     # use Texinfo::Config
-    bless $cmdline_options;
-    return $cmdline_options;
+    $config = {'standalone' => 0, 'config' => {}};
   }
+  bless $config;
+  return $config;
 }
 
 sub get_conf($$)
@@ -507,10 +504,25 @@ sub get_conf($$)
   my $self = shift;
   my $var = shift;
 
-  if (defined($additional_conf->{$var})) {
-    return $additional_conf->{$var};
+  if ($self->{'standalone'}) {
+    if (defined($self->{'config'}->{$var})) {
+      return $self->{'config'}->{$var};
+    }
+  } else {
+    # as get_conf, but with self having precedence on
+    # main program defaults
+    if (exists($cmdline_options->{$var})) {
+      return $cmdline_options->{$var};
+    } elsif (exists($init_files_options->{$var})) {
+      return $init_files_options->{$var};
+    } elsif (exists($self->{'config'}->{$var})) {
+      return $self->{'config'}->{$var};
+    } elsif (exists($main_program_default_options->{$var})) {
+      return $main_program_default_options->{$var};
+    } else {
+      return undef;
+    }
   }
-  return Texinfo::Config::texinfo_get_conf($var);
 }
 
 sub set_conf($$$)
@@ -518,8 +530,7 @@ sub set_conf($$$)
   my $self = shift;
   my $var = shift;
   my $val = shift;
-  # overrides command line
-  $additional_conf->{$var} = $val;
+  $self->{'config'}->{$var} = $val;
 }
 
 
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 8c3a6390b4..bfb2c33867 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -779,7 +779,8 @@ sub parser(;$$)
 # simple parser initialization.  The only difference with a regular parser
 # is that the dynamical @-commands groups and indices informations that are
 # initialized in each regular parser are initialized once for all and shared
-# among simple parsers.
+# among simple parsers.  It is used in gdt() and this has a sizable effect
+# on performance.
 my $simple_parser_line_commands = dclone(\%line_commands);
 my $simple_parser_valid_nestings = dclone(\%default_valid_nestings);
 my $simple_parser_no_paragraph_commands = { %default_no_paragraph_commands };
@@ -959,6 +960,7 @@ sub _set_global_informations($)
 {
   my $self = shift;
 
+  #if ($self->{'novalidate'}
   if ($self->get_conf('novalidate')
       or $self->global_commands_information()->{'novalidate'}) {
     $self->{'info'}->{'novalidate'} = 1;
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index 1f9b64d385..fd2017f2b3 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -559,6 +559,13 @@ sub _print_down_menus($$)
   return @master_menu_contents;
 }
 
+if (0) {
+  # it is needed to mark the translation as gdt is called like
+  # Texinfo::Translations::gdt($self, ' --- The Detailed Node Listing ---')
+  # and not like gdt(' --- The Detailed Node Listing ---')
+  gdt(' --- The Detailed Node Listing ---');
+}
+
 sub new_master_menu($$)
 {
   my $self = shift;
diff --git a/tp/maintain/all_tests.sh b/tp/maintain/all_tests.sh
index 748df424e7..b09ec1f3e2 100755
--- a/tp/maintain/all_tests.sh
+++ b/tp/maintain/all_tests.sh
@@ -36,7 +36,7 @@ elif [ "$command" = 'diff' ]; then
     done
     for result in t/results/*/*/res*/; do
       out=`echo $result | sed 's;res\([^/]*/\)$;out\1;'`
-      diff -a -u --exclude=CVS --exclude=.svn -r $result $out
+      diff -a -u -r $result $out
     done
   else
     for result in t/results/$test_name/*.pl; do
@@ -44,7 +44,7 @@ elif [ "$command" = 'diff' ]; then
     done
     for result in t/results/$test_name/*/res*/; do
       out=`echo $result | sed 's;res\([^/]*/\)$;out\1;'`
-      diff -a -u --exclude=CVS --exclude=.svn -r $result $out
+      diff -a -u -r $result $out
     done
   fi 
 else
diff --git a/tp/tests/Makefile.am b/tp/tests/Makefile.am
index a33e8be5a5..2783f85f31 100644
--- a/tp/tests/Makefile.am
+++ b/tp/tests/Makefile.am
@@ -28,6 +28,7 @@ SUBDIRS = . many_input_files
 
 copy-tests:
        $(srcdir)/parser_tests.sh -copy $(base_tests)
+       cd many_input_files && $(MAKE) copy-tests
 
 copy-tex-html:
        $(srcdir)/parser_tests.sh -copy $(tex_html_tests)
diff --git a/tp/tests/many_input_files/Makefile.am 
b/tp/tests/many_input_files/Makefile.am
index 20ced4249e..af41e48241 100644
--- a/tp/tests/many_input_files/Makefile.am
+++ b/tp/tests/many_input_files/Makefile.am
@@ -10,13 +10,19 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 EXTRA_DIST = $(TESTS) \
-  tex_l2h_res tex_t4ht_res
+  tex_l2h_res tex_t4ht_res different_encodings_res 
different_languages_gen_master_menu_res \
+  input_files/no_master_menu_fr.texi \
+  input_files/no_master_menu_no_documentlanguage.texi
 
-TESTS = tex_l2h.sh tex_t4ht.sh
+
+TESTS = tex_l2h.sh tex_t4ht.sh \
+  different_encodings.sh different_languages_gen_master_menu.sh
 AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir; 
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export 
buildir; top_builddir="$(top_builddir)"; export top_builddir;
 
 tex_html_dirs = tex_l2h tex_t4ht
 
+tests_dirs = different_encodings different_languages_gen_master_menu
+
 long-checks: all
        $(MAKE) $(AM_MAKEFLAGS) check LONG_TESTS=yes
 
@@ -38,12 +44,26 @@ copy-tex-html:
                fi; \
        done
 
+copy-tests:
+       for dir in $(tests_dirs); do \
+               if [ -d "$$dir" ]; then \
+                       if [ -d "${srcdir}/$${dir}_res" ]; then \
+                               rm -f "${srcdir}/$${dir}_res/"*.* ;\
+                       else \
+                               mkdir "${srcdir}/$${dir}_res/" ; \
+                       fi ;\
+                       cp -p "$$dir/"*.* "${srcdir}/$${dir}_res/"; \
+               else \
+                       echo "No dir $$dir/"; \
+               fi; \
+       done
+
 DISTCLEANFILES = *.log
 
 distclean-local:
-       rm -rf diffs $(tex_html_dirs) raw_out
+       rm -rf diffs $(tex_html_dirs) $(tests_dirs) raw_out
 
 dist-hook:
-       for dir in $(tex_html_dirs); do \
+       for dir in $(tex_html_dirs) $(tests_dirs); do \
                rm -rf `find "$(distdir)/$${dir}_res" -name .git` ;\
        done
diff --git a/tp/tests/many_input_files/different_encodings.sh 
b/tp/tests/many_input_files/different_encodings.sh
new file mode 100755
index 0000000000..04eb778c24
--- /dev/null
+++ b/tp/tests/many_input_files/different_encodings.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+#
+# Copyright 2022 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Originally written by Patrice Dumas.
+
+LC_ALL=C; export LC_ALL
+
+basename=different_encodings
+diffs_dir=diffs
+raw_output_dir=raw_out
+logfile=$basename.log
+stdout_file=stdout_$basename.out
+
+[ "z$srcdir" = 'z' ] && srcdir=.
+
+. ../../defs || exit 1
+
+[ -d $diffs_dir ] || mkdir $diffs_dir
+staging_dir=$diffs_dir/staging
+[ -d $staging_dir ] || mkdir $staging_dir
+[ -d $raw_output_dir ] || mkdir $raw_output_dir
+
+echo "$basename" > $logfile
+
+[ -d $basename ] && rm -rf $basename
+raw_outdir=$raw_output_dir/$basename
+[ -d $raw_outdir ] && rm -rf $raw_outdir
+mkdir $basename
+: > $basename/$stdout_file
+echo "$PERL -I $srcdir/../.. -I 
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I 
$srcdir/../../maintain/lib/libintl-perl/lib -I 
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl 
--html --no-split --set-customization-variable 'TEST 1' --enable-encoding 
--conf-dir $srcdir/../../init --out $basename/ 
$srcdir/../../t/input_files/char_latin1_latin1_in_refs.texi 
$srcdir/../../t/input_files/char_latin1_utf8_in_refs.texi --force >> 
$basename/$stdout_file 2>$bas [...]
+$PERL -I $srcdir/../.. -I 
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I 
$srcdir/../../maintain/lib/libintl-perl/lib -I 
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl 
--html --no-split --set-customization-variable 'TEST 1' --enable-encoding 
--conf-dir $srcdir/../../init --out $basename/ 
$srcdir/../../t/input_files/char_latin1_latin1_in_refs.texi 
$srcdir/../../t/input_files/char_latin1_utf8_in_refs.texi --force >> 
$basename/$stdout_file 2>$basename/ [...]
+
+return_code=0
+ret=$?
+if [ $ret != 0 ]; then
+  echo "F: $basename/$basename.2"
+  return_code=1
+else
+  outdir=$basename
+  cp -pr $outdir $raw_output_dir
+    
+  dir=$basename
+  if [ -d "$srcdir/${dir}_res" ]; then
+    rm -rf $staging_dir/${dir}_res
+    cp -pr "$srcdir/${dir}_res" $staging_dir
+    chmod -R u+w "$staging_dir/${dir}_res"
+    diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile > 
"$diffs_dir/$dir.diff"
+    dif_ret=$?
+    if [ $dif_ret != 0 ]; then
+      echo "D: $diffs_dir/$dir.diff"
+      return_code=1
+    else
+      rm "$diffs_dir/$dir.diff"
+    fi
+  else
+    echo "no res: ${dir}_res"
+  fi
+fi
+
+rm -rf $tmp_dir
+
+exit $return_code
diff --git 
a/tp/tests/many_input_files/different_encodings_res/char_latin1_latin1_in_refs.html
 
b/tp/tests/many_input_files/different_encodings_res/char_latin1_latin1_in_refs.html
new file mode 100644
index 0000000000..1479e797a2
--- /dev/null
+++ 
b/tp/tests/many_input_files/different_encodings_res/char_latin1_latin1_in_refs.html
@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>top</title>
+
+<meta name="description" content="top">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="#Top" rel="index" title="Top">
+<link 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
rel="next" title="� � � � � � � � � � �">
+<style type="text/css">
+<!--
+a.summary-letter-printindex {text-decoration: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="n" rel="next">� � � � � � � � � � �</a> &nbsp; [<a href="#Top" 
title="Index" rel="index">Index</a>]</p>
+</div>
+<h1 class="top" id="top">top</h1>
+
+<div class="printindex cp-printindex">
+<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to: 
&nbsp; </th><td><a class="summary-letter-printindex" 
href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+</td></tr></table>
+<table class="cp-entries-printindex" border="0">
+<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> 
Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-�">�</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-a-e-i-o-u-A-E-I-O-U">� � � � � � 
� � � �</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#g_t_00e7">�</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-�">�</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-A-E-I-O-U">� � � � 
�</a>:</td><td>&nbsp;</td><td valign="top"><a href="#g_t_00e7">�</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-a-e-i-o-u-y">� � � � � 
�</a>:</td><td>&nbsp;</td><td valign="top"><a href="#g_t_00e7">�</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-�">�</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-c">�</a>:</td><td>&nbsp;</td><td 
valign="top"><a href="#g_t_00e7">�</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-�">�</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a 
href="#index-e-1">�</a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#g_t_00e7">�</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-�">�</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-e">�</a>:</td><td>&nbsp;</td><td 
valign="top"><a href="#g_t_00e7">�</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to: 
&nbsp; </th><td><a class="summary-letter-printindex" 
href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+<a class="summary-letter-printindex" href="#Top_cp_letter-�"><b>�</b></a>
+ &nbsp; 
+</td></tr></table>
+</div>
+
+
+<ul class="mini-toc">
+<li><a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="1">� � � � � � � � � � �</a></li>
+<li><a href="#g_t_00e9" accesskey="2">�</a></li>
+<li><a href="#g_t_00e0-_00e8-_00f9" accesskey="3">� � �</a></li>
+<li><a href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="4">� � � � � � � � � �</a></li>
+<li><a href="#g_t_00e7" accesskey="5">�</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" 
id="g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e9" accesskey="n" rel="next">�</a>, Previous: <a 
href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top" accesskey="u" 
rel="up">top</a> &nbsp; [<a href="#Top" title="Index" rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-i-o-u-y-A-E-I-O-U">1 � � � � � � � � � � �</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e9">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e0-_00e8-_00f9" accesskey="n" rel="next">� � �</a>, 
Previous: <a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="p" rel="prev">� � � � � � � � � � �</a>, Up: <a href="#Top" 
accesskey="u" rel="up">top</a> &nbsp; [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="e">2 �</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e0-_00e8-_00f9">
+<div class="nav-panel">
+<p>
+Next: <a 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="n" rel="next">� � � � � � � � � �</a>, Previous: <a href="#g_t_00e9" 
accesskey="p" rel="prev">�</a>, Up: <a href="#Top" accesskey="u" 
rel="up">top</a> &nbsp; [<a href="#Top" title="Index" rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-u">3 � � �</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" 
id="g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e7" accesskey="n" rel="next">�</a>, Previous: <a 
href="#g_t_00e0-_00e8-_00f9" accesskey="p" rel="prev">� � �</a>, Up: <a 
href="#Top" accesskey="u" rel="up">top</a> &nbsp; [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-i-o-u-A-E-I-O-U">4 � � � � � � � � � �</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e7">
+<div class="nav-panel">
+<p>
+Previous: <a 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="p" rel="prev">� � � � � � � � � �</a>, Up: <a href="#Top" 
accesskey="u" rel="up">top</a> &nbsp; [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="c">5 �</h2>
+
+<p><a class="ref" 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc">� 
� � � � � � � � � �</a>
+<a class="ref" href="#g_t_00e9">�</a>
+<a class="ref" href="#g_t_00e0-_00e8-_00f9">� � �</a>
+<a class="ref" 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db">� � � � 
� � � � � �</a>
+<a class="ref" href="#g_t_00e7">�</a>
+</p>
+<a class="index-entry-id" id="index-a-e-i-o-u-y"></a>
+<a class="index-entry-id" id="index-A-E-I-O-U"></a>
+<a class="index-entry-id" id="index-e"></a>
+<a class="index-entry-id" id="index-e-1"></a>
+<a class="index-entry-id" id="index-a-e-i-o-u-A-E-I-O-U"></a>
+<a class="index-entry-id" id="index-c"></a>
+
+</div>
+</div>
+
+
+
+</body>
+</html>
diff --git 
a/tp/tests/many_input_files/different_encodings_res/char_latin1_utf8_in_refs.html
 
b/tp/tests/many_input_files/different_encodings_res/char_latin1_utf8_in_refs.html
new file mode 100644
index 0000000000..94322537f6
--- /dev/null
+++ 
b/tp/tests/many_input_files/different_encodings_res/char_latin1_utf8_in_refs.html
@@ -0,0 +1,153 @@
+<!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</title>
+
+<meta name="description" content="top">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="#Top" rel="index" title="Top">
+<link 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
rel="next" title="ä ë ï ö ü ÿ Ä Ë Ï Ö Ü">
+<style type="text/css">
+<!--
+a.summary-letter-printindex {text-decoration: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="n" rel="next">ä ë ï ö ü ÿ Ä Ë Ï Ö Ü</a>   [<a href="#Top" 
title="Index" rel="index">Index</a>]</p>
+</div>
+<h1 class="top" id="top">top</h1>
+
+<div class="printindex cp-printindex">
+<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:   
</th><td><a class="summary-letter-printindex" 
href="#Top_cp_letter-Â"><b>Â</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-Ä"><b>Ä</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-Ç"><b>Ç</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-È"><b>È</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-É"><b>É</b></a>
+   
+</td></tr></table>
+<table class="cp-entries-printindex" border="0">
+<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> 
Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-Â">Â</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-a-e-i-o-u-A-E-I-O-U">â ê î ô û Â 
Ê Î Ô Û</a>:</td><td> </td><td valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-Ä">Ä</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-A-E-I-O-U">Ä Ë Ï Ö 
Ü</a>:</td><td> </td><td valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-a-e-i-o-u-y">ä ë ï ö ü 
ÿ</a>:</td><td> </td><td valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-Ç">Ç</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-c">ç</a>:</td><td> </td><td 
valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-È">È</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-e-1">è</a>:</td><td> </td><td 
valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Top_cp_letter-É">É</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-e">é</a>:</td><td> </td><td 
valign="top"><a href="#g_t_00e7">ç</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:   
</th><td><a class="summary-letter-printindex" 
href="#Top_cp_letter-Â"><b>Â</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-Ä"><b>Ä</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-Ç"><b>Ç</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-È"><b>È</b></a>
+   
+<a class="summary-letter-printindex" href="#Top_cp_letter-É"><b>É</b></a>
+   
+</td></tr></table>
+</div>
+
+
+<ul class="mini-toc">
+<li><a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="1">ä ë ï ö ü ÿ Ä Ë Ï Ö Ü</a></li>
+<li><a href="#g_t_00e9" accesskey="2">é</a></li>
+<li><a href="#g_t_00e0-_00e8-_00f9" accesskey="3">à è ù</a></li>
+<li><a href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="4">â ê î ô û Â Ê Î Ô Û</a></li>
+<li><a href="#g_t_00e7" accesskey="5">ç</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" 
id="g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e9" accesskey="n" rel="next">é</a>, Previous: <a 
href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top" accesskey="u" 
rel="up">top</a>   [<a href="#Top" title="Index" rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-i-o-u-y-A-E-I-O-U">1 ä ë ï ö ü ÿ Ä Ë Ï Ö Ü</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e9">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e0-_00e8-_00f9" accesskey="n" rel="next">à è ù</a>, 
Previous: <a 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc" 
accesskey="p" rel="prev">ä ë ï ö ü ÿ Ä Ë Ï Ö Ü</a>, Up: <a href="#Top" 
accesskey="u" rel="up">top</a>   [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="e">2 é</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e0-_00e8-_00f9">
+<div class="nav-panel">
+<p>
+Next: <a 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="n" rel="next">â ê î ô û Â Ê Î Ô Û</a>, Previous: <a href="#g_t_00e9" 
accesskey="p" rel="prev">é</a>, Up: <a href="#Top" accesskey="u" 
rel="up">top</a>   [<a href="#Top" title="Index" rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-u">3 à è ù</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" 
id="g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db">
+<div class="nav-panel">
+<p>
+Next: <a href="#g_t_00e7" accesskey="n" rel="next">ç</a>, Previous: <a 
href="#g_t_00e0-_00e8-_00f9" accesskey="p" rel="prev">à è ù</a>, Up: <a 
href="#Top" accesskey="u" rel="up">top</a>   [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="a-e-i-o-u-A-E-I-O-U">4 â ê î ô û Â Ê Î Ô Û</h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="g_t_00e7">
+<div class="nav-panel">
+<p>
+Previous: <a 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db" 
accesskey="p" rel="prev">â ê î ô û Â Ê Î Ô Û</a>, Up: <a href="#Top" 
accesskey="u" rel="up">top</a>   [<a href="#Top" title="Index" 
rel="index">Index</a>]</p>
+</div>
+<h2 class="chapter" id="c">5 ç</h2>
+
+<p><a class="ref" 
href="#g_t_00e4-_00eb-_00ef-_00f6-_00fc-_00ff-_00c4-_00cb-_00cf-_00d6-_00dc">ä 
ë ï ö ü ÿ Ä Ë Ï Ö Ü</a>
+<a class="ref" href="#g_t_00e9">é</a>
+<a class="ref" href="#g_t_00e0-_00e8-_00f9">à è ù</a>
+<a class="ref" 
href="#g_t_00e2-_00ea-_00ee-_00f4-_00fb-_00c2-_00ca-_00ce-_00d4-_00db">â ê î ô 
û Â Ê Î Ô Û</a>
+<a class="ref" href="#g_t_00e7">ç</a>
+</p>
+<a class="index-entry-id" id="index-a-e-i-o-u-y"></a>
+<a class="index-entry-id" id="index-A-E-I-O-U"></a>
+<a class="index-entry-id" id="index-e"></a>
+<a class="index-entry-id" id="index-e-1"></a>
+<a class="index-entry-id" id="index-a-e-i-o-u-A-E-I-O-U"></a>
+<a class="index-entry-id" id="index-c"></a>
+
+</div>
+</div>
+
+
+
+</body>
+</html>
diff --git 
a/tp/tests/many_input_files/different_encodings_res/different_encodings.2 
b/tp/tests/many_input_files/different_encodings_res/different_encodings.2
new file mode 100644
index 0000000000..e69de29bb2
diff --git 
a/tp/tests/many_input_files/different_encodings_res/stdout_different_encodings.out
 
b/tp/tests/many_input_files/different_encodings_res/stdout_different_encodings.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tp/tests/many_input_files/different_languages_gen_master_menu.sh 
b/tp/tests/many_input_files/different_languages_gen_master_menu.sh
new file mode 100755
index 0000000000..36a5c57051
--- /dev/null
+++ b/tp/tests/many_input_files/different_languages_gen_master_menu.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+#
+# Copyright 2022 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Originally written by Patrice Dumas.
+
+LC_ALL=C; export LC_ALL
+
+basename=different_languages_gen_master_menu
+diffs_dir=diffs
+raw_output_dir=raw_out
+logfile=$basename.log
+stdout_file=stdout_$basename.out
+
+[ "z$srcdir" = 'z' ] && srcdir=.
+
+. ../../defs || exit 1
+
+[ -d $diffs_dir ] || mkdir $diffs_dir
+staging_dir=$diffs_dir/staging
+[ -d $staging_dir ] || mkdir $staging_dir
+[ -d $raw_output_dir ] || mkdir $raw_output_dir
+
+echo "$basename" > $logfile
+
+[ -d $basename ] && rm -rf $basename
+raw_outdir=$raw_output_dir/$basename
+[ -d $raw_outdir ] && rm -rf $raw_outdir
+mkdir $basename
+: > $basename/$stdout_file
+echo "$PERL -I $srcdir/../.. -I 
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I 
$srcdir/../../maintain/lib/libintl-perl/lib -I 
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl 
--html --no-split -c FORMAT_MENU=menu -c 
TREE_TRANSFORMATIONS=regenerate_master_menu --set-customization-variable 'TEST 
1' --conf-dir $srcdir/../../init --out $basename/ 
$srcdir/input_files/no_master_menu_fr.texi 
$srcdir/input_files/no_master_menu_pt.texi --force >> $basename/$s [...]
+$PERL -I $srcdir/../.. -I 
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I 
$srcdir/../../maintain/lib/libintl-perl/lib -I 
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl 
--html --no-split -c FORMAT_MENU=menu -c 
TREE_TRANSFORMATIONS=regenerate_master_menu --set-customization-variable 'TEST 
1' --conf-dir $srcdir/../../init --out $basename/ 
$srcdir/input_files/no_master_menu_fr.texi 
$srcdir/input_files/no_master_menu_no_documentlanguage.texi --force >> $ [...]
+
+return_code=0
+ret=$?
+if [ $ret != 0 ]; then
+  echo "F: $basename/$basename.2"
+  return_code=1
+else
+  outdir=$basename
+  cp -pr $outdir $raw_output_dir
+    
+  dir=$basename
+  if [ -d "$srcdir/${dir}_res" ]; then
+    rm -rf $staging_dir/${dir}_res
+    cp -pr "$srcdir/${dir}_res" $staging_dir
+    chmod -R u+w "$staging_dir/${dir}_res"
+    diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile > 
"$diffs_dir/$dir.diff"
+    dif_ret=$?
+    if [ $dif_ret != 0 ]; then
+      echo "D: $diffs_dir/$dir.diff"
+      return_code=1
+    else
+      rm "$diffs_dir/$dir.diff"
+    fi
+  else
+    echo "no res: ${dir}_res"
+  fi
+fi
+
+rm -rf $tmp_dir
+
+exit $return_code
diff --git 
a/tp/tests/many_input_files/different_languages_gen_master_menu_res/different_languages_gen_master_menu.2
 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/different_languages_gen_master_menu.2
new file mode 100644
index 0000000000..e69de29bb2
diff --git 
a/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_fr.html
 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_fr.html
new file mode 100644
index 0000000000..2d65238a60
--- /dev/null
+++ 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_fr.html
@@ -0,0 +1,75 @@
+<!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>max</title>
+
+<meta name="description" content="max">
+<meta name="keywords" content="max">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="#chap" rel="next" title="chap">
+<style type="text/css">
+<!--
+pre.menu-comment-preformatted {font-family: serif}
+-->
+</style>
+
+
+</head>
+
+<body lang="fr">
+
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Suivant: <a href="#chap" accesskey="n" rel="next">chap</a> &nbsp; </p>
+</div>
+<h1 class="top" id="max">max</h1>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#chap" 
accesskey="1">chap</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><th colspan="3" align="left" valign="top"><pre 
class="menu-comment-preformatted">
+
+</pre></th></tr><tr><th colspan="3" align="left" valign="top"><pre 
class="menu-comment-preformatted"> &mdash; The Detailed Node Listing &mdash;
+
+chap
+
+</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#section" 
accesskey="2">section</a>:</td><td>&nbsp;&nbsp;</td><td align="left" 
valign="top">
+</td></tr>
+</table>
+
+<hr>
+<div class="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+Pr&eacute;c&eacute;dent: <a href="#Top" accesskey="p" rel="prev">max</a>, 
Monter: <a href="#Top" accesskey="u" rel="up">max</a> &nbsp; </p>
+</div>
+<h2 class="chapter" id="chap-1">1 chap</h2>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#section" 
accesskey="1">section</a>:</td><td>&nbsp;&nbsp;</td><td align="left" 
valign="top">
+</td></tr>
+</table>
+
+<hr>
+<div class="section-level-extent" id="section">
+<div class="nav-panel">
+<p>
+Monter: <a href="#chap" accesskey="u" rel="up">chap</a> &nbsp; </p>
+</div>
+<h3 class="section" id="sec">1.1 sec</h3>
+</div>
+</div>
+</div>
+
+
+
+</body>
+</html>
diff --git 
a/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_no_documentlanguage.html
 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_no_documentlanguage.html
new file mode 100644
index 0000000000..40c74041c1
--- /dev/null
+++ 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/no_master_menu_no_documentlanguage.html
@@ -0,0 +1,74 @@
+<!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>max</title>
+
+<meta name="description" content="max">
+<meta name="keywords" content="max">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="#chap" rel="next" title="chap">
+<style type="text/css">
+<!--
+pre.menu-comment-preformatted {font-family: serif}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="#chap" accesskey="n" rel="next">chap</a> &nbsp; </p>
+</div>
+<h1 class="top" id="max">max</h1>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#chap" 
accesskey="1">chap</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><th colspan="3" align="left" valign="top"><pre 
class="menu-comment-preformatted">
+
+</pre></th></tr><tr><th colspan="3" align="left" valign="top"><pre 
class="menu-comment-preformatted"> &mdash; The Detailed Node Listing &mdash;
+
+chap
+
+</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#section" 
accesskey="2">section</a>:</td><td>&nbsp;&nbsp;</td><td align="left" 
valign="top">
+</td></tr>
+</table>
+
+<hr>
+<div class="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">max</a>, Up: <a href="#Top" 
accesskey="u" rel="up">max</a> &nbsp; </p>
+</div>
+<h2 class="chapter" id="chap-1">1 chap</h2>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#section" 
accesskey="1">section</a>:</td><td>&nbsp;&nbsp;</td><td align="left" 
valign="top">
+</td></tr>
+</table>
+
+<hr>
+<div class="section-level-extent" id="section">
+<div class="nav-panel">
+<p>
+Up: <a href="#chap" accesskey="u" rel="up">chap</a> &nbsp; </p>
+</div>
+<h3 class="section" id="sec">1.1 sec</h3>
+</div>
+</div>
+</div>
+
+
+
+</body>
+</html>
diff --git 
a/tp/tests/many_input_files/different_languages_gen_master_menu_res/stdout_different_languages_gen_master_menu.out
 
b/tp/tests/many_input_files/different_languages_gen_master_menu_res/stdout_different_languages_gen_master_menu.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tp/tests/many_input_files/input_files/no_master_menu_fr.texi 
b/tp/tests/many_input_files/input_files/no_master_menu_fr.texi
new file mode 100644
index 0000000000..f0f0040ca6
--- /dev/null
+++ b/tp/tests/many_input_files/input_files/no_master_menu_fr.texi
@@ -0,0 +1,20 @@
+\input texinfo.tex
+
+@documentlanguage fr
+
+@node Top
+@top max
+
+@menu
+* chap::
+@end menu
+
+@node chap
+@chapter chap
+
+@menu
+* section::
+@end menu
+
+@node section
+@section sec
diff --git 
a/tp/tests/many_input_files/input_files/no_master_menu_no_documentlanguage.texi 
b/tp/tests/many_input_files/input_files/no_master_menu_no_documentlanguage.texi
new file mode 100644
index 0000000000..63307be786
--- /dev/null
+++ 
b/tp/tests/many_input_files/input_files/no_master_menu_no_documentlanguage.texi
@@ -0,0 +1,18 @@
+\input texinfo.tex
+
+@node Top
+@top max
+
+@menu
+* chap::
+@end menu
+
+@node chap
+@chapter chap
+
+@menu
+* section::
+@end menu
+
+@node section
+@section sec
diff --git a/tp/tests/many_input_files/input_files/no_master_menu_pt.texi 
b/tp/tests/many_input_files/input_files/no_master_menu_pt.texi
new file mode 100644
index 0000000000..d97e9ef9a6
--- /dev/null
+++ b/tp/tests/many_input_files/input_files/no_master_menu_pt.texi
@@ -0,0 +1,20 @@
+\input texinfo.tex
+
+@documentlanguage pt
+
+@node Top
+@top max
+
+@menu
+* chap::
+@end menu
+
+@node chap
+@chapter chap
+
+@menu
+* section::
+@end menu
+
+@node section
+@section sec
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 2dc5010aa8..440548665e 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -400,10 +400,6 @@ my $parser_options = {'values' => 
{'txicommandconditionals' => 1}};
 my $init_files_options = Texinfo::Config::GNUT_initialize_config(
       $real_command_name, $main_program_default_options, $cmdline_options);
 
-# setup a configuration object which defines get_conf and gives the same as
-# get_conf() in main program
-my $main_configuration = Texinfo::MainConfig::new();
-
 # read initialization files.  Better to do that after
 # Texinfo::Config::GNUT_initialize_config() in case loaded
 # files replace default options.
@@ -1206,8 +1202,27 @@ while(@input_files) {
     Texinfo::Transformations::set_menus_to_simple_menu($nodes_list);
   }
 
+  # setup a configuration object which defines get_conf and gives the same as
+  # get_conf() in main program
+  my $main_configuration = Texinfo::MainConfig::new();
+
   my $parser_informations = $parser->global_informations();
+  # encoding is needed for output files
+  # encoding and documentlanguage are needed for gdt() in 
regenerate_master_menu
   Texinfo::Common::set_output_encodings($main_configuration, 
$parser_informations);
+  my $global_commands = $parser->global_commands_information();
+  # FIXME this is a kind of simplified version of
+  # Texinfo::Convert::Converter::set_global_document_commands
+  # setup a full version in Common.pm
+  if (not defined($main_configuration->get_conf('documentlanguage'))) {
+    if (defined($global_commands->{'documentlanguage'})) {
+      my $element = $global_commands->{'documentlanguage'}->[0];
+      my $document_language = $element->{'extra'}->{'text_arg'};
+      if (defined($document_language)) {
+        $main_configuration->set_conf('documentlanguage', $document_language);
+      }
+    }
+  }
 
   if (defined(get_conf('MACRO_EXPAND')) and $file_number == 0) {
     require Texinfo::Convert::Texinfo;
@@ -1284,7 +1299,6 @@ while(@input_files) {
             = Texinfo::Structuring::sectioning_structure($registrar,
                                                $main_configuration, $tree);
 
-  my $global_commands = $parser->global_commands_information();
   if ($sectioning_root) {
     $structure_informations->{'sectioning_root'} = $sectioning_root;
     $structure_informations->{'sections_list'} = $sections_list;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]