texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/texi2any.pl: call get_conf() only after conf


From: Patrice Dumas
Subject: branch master updated: * tp/texi2any.pl: call get_conf() only after conf is setup.
Date: Sun, 20 Feb 2022 16:28:23 -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 9153ae2dde * tp/texi2any.pl: call get_conf() only after conf is setup.
9153ae2dde is described below

commit 9153ae2dde69d226855c448be627f3588d97289a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 20 22:28:12 2022 +0100

    * tp/texi2any.pl: call get_conf() only after conf is setup.
---
 ChangeLog      |  4 ++++
 tp/texi2any.pl | 28 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 30dd2ed88b..62dd1ff141 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-02-20  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/texi2any.pl: call get_conf() only after conf is setup.
+
 2022-02-20  Patrice Dumas  <pertusus@free.fr>
 
        Decode input data to perl internal and encode messages
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index f828772a5f..5fc1180c48 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -349,20 +349,6 @@ sub _decode_i18n_string($$)
   return Encode::decode($encoding, $string);
 }
 
-# FIXME should we reset the messages encoding if 'DATA_INPUT_ENCODING_NAME'
-# is reset?
-my $messages_encoding = get_conf('DATA_INPUT_ENCODING_NAME');
-if (defined($messages_encoding) and $messages_encoding ne 'us-ascii') {
-  my $Encode_encoding_object = find_encoding($messages_encoding);
-  my $perl_messages_encoding = $Encode_encoding_object->name();
-  Locale::Messages::bind_textdomain_codeset($messages_textdomain,
-                                            $messages_encoding);
-  if ($perl_messages_encoding) {
-    Locale::Messages::bind_textdomain_filter($messages_textdomain,
-                          \&_decode_i18n_string, $perl_messages_encoding);
-  }
-}
-
 sub _encode_message($)
 {
   my $text = shift;
@@ -457,6 +443,20 @@ my $parser_options = {'values' => 
{'txicommandconditionals' => 1}};
 my $init_files_options = Texinfo::Config::GNUT_initialize_config(
       $real_command_name, $main_program_default_options, $cmdline_options);
 
+# FIXME should we reset the messages encoding if 'DATA_INPUT_ENCODING_NAME'
+# is reset?
+my $messages_encoding = get_conf('DATA_INPUT_ENCODING_NAME');
+if (defined($messages_encoding) and $messages_encoding ne 'us-ascii') {
+  my $Encode_encoding_object = find_encoding($messages_encoding);
+  my $perl_messages_encoding = $Encode_encoding_object->name();
+  Locale::Messages::bind_textdomain_codeset($messages_textdomain,
+                                            $messages_encoding);
+  if ($perl_messages_encoding) {
+    Locale::Messages::bind_textdomain_filter($messages_textdomain,
+                          \&_decode_i18n_string, $perl_messages_encoding);
+  }
+}
+
 # read initialization files.  Better to do that after
 # Texinfo::Config::GNUT_initialize_config() in case loaded
 # files replace default options.



reply via email to

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