texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Add NO_GRATUITOUS_UTF8 (name could change)


From: Gavin D. Smith
Subject: branch master updated: Add NO_GRATUITOUS_UTF8 (name could change)
Date: Sun, 26 Feb 2023 10:54:09 -0500

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 24ee52203b Add NO_GRATUITOUS_UTF8 (name could change)
24ee52203b is described below

commit 24ee52203b0364eab357b001541c14be40dac2c9
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Feb 26 13:14:09 2023 +0000

    Add NO_GRATUITOUS_UTF8 (name could change)
    
    * tp/Texinfo/Common.pm (@variable_string_settables):
    Add NO_GRATUITOUS_UTF8.
    * tp/Texinfo/Convert/Plaintext.pm (converter_initialize):
    Set several other variables if NO_GRATUITOUS_UTF8 is set.
    Move call to Texinfo::Convert::Text::copy_options_for_convert_text
    to end of function as it is not immediately obvious which options
    are relevant for this call.
---
 ChangeLog                       | 12 ++++++++++++
 tp/Texinfo/Common.pm            |  1 +
 tp/Texinfo/Convert/Plaintext.pm | 17 +++++++++++++----
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 64f153d6e1..d7ff9ded7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2023-02-26  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Add NO_GRATUITOUS_UTF8 (name could change)
+
+       * tp/Texinfo/Common.pm (@variable_string_settables):
+       Add NO_GRATUITOUS_UTF8.
+       * tp/Texinfo/Convert/Plaintext.pm (converter_initialize):
+       Set several other variables if NO_GRATUITOUS_UTF8 is set.
+       Move call to Texinfo::Convert::Text::copy_options_for_convert_text
+       to end of function as it is not immediately obvious which options
+       are relevant for this call.
+
 2023-02-26  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/NodeNameNormalization.pm (set_nodes_list_labels):
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 52336313b1..7214b22299 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -411,6 +411,7 @@ our @variable_string_settables = (
 'NO_CSS',
 'NO_NUMBER_FOOTNOTE_SYMBOL',
 'NO_CUSTOM_HTML_ATTRIBUTE',
+'NO_GRATUITOUS_UTF8',
 'NODE_NAME_IN_INDEX',
 'NODE_NAME_IN_MENU',
 'NO_TOP_NODE_OUTPUT',
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 33076df5e6..81038fd767 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -431,10 +431,14 @@ sub converter_initialize($)
        unless ($self->{'expanded_formats_hash'}->{$format});
   }
 
-  %{$self->{'style_map'}} = %style_map;
-  $self->{'convert_text_options'}
-      = {Texinfo::Convert::Text::copy_options_for_convert_text($self)};
-
+  if ($self->get_conf('NO_GRATUITOUS_UTF8')) {
+    $self->set_conf('ASCII_PUNCTUATION', 1);
+    $self->set_conf('ASCII_GLYPH', 1);
+    $self->set_conf('OPEN_QUOTE_SYMBOL', '\'');
+    $self->set_conf('CLOSE_QUOTE_SYMBOL', '\'');
+    $self->set_conf('OPEN_DOUBLE_QUOTE_SYMBOL', '"');
+    $self->set_conf('CLOSE_DOUBLE_QUOTE_SYMBOL', '"');
+  }
   if ($self->get_conf('ASCII_PUNCTUATION')) {
     # cache to avoid calling get_conf
     $self->{'ascii_punctuation'} = 1;
@@ -442,6 +446,8 @@ sub converter_initialize($)
     $self->{'ascii_punctuation'} = 0;
   }
 
+  %{$self->{'style_map'}} = %style_map;
+
   if ($self->get_conf('ENABLE_ENCODING')
       and $self->get_conf('OUTPUT_ENCODING_NAME')
       and $self->get_conf('OUTPUT_ENCODING_NAME') eq 'utf-8') {
@@ -518,6 +524,9 @@ sub converter_initialize($)
   $self->{'output_encoding_name'} = $self->get_conf('OUTPUT_ENCODING_NAME');
   $self->{'debug'} = $self->get_conf('DEBUG');
 
+  $self->{'convert_text_options'}
+      = {Texinfo::Convert::Text::copy_options_for_convert_text($self)};
+
   return $self;
 }
 



reply via email to

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