texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/Converter.pm (%XS_overrides,


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Converter.pm (%XS_overrides, set_document), tp/Texinfo/XS/convert/ConvertXS.xs (converter_set_document): call call_common_set_output_perl_encoding in converter_set_document and override the whole set_document Perl function.
Date: Thu, 03 Oct 2024 13:37:48 -0400

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 5713a36c1e * tp/Texinfo/Convert/Converter.pm (%XS_overrides, 
set_document), tp/Texinfo/XS/convert/ConvertXS.xs (converter_set_document): 
call call_common_set_output_perl_encoding in converter_set_document and 
override the whole set_document Perl function.
5713a36c1e is described below

commit 5713a36c1ea1ffe46479663b7724f8821584c8b8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Aug 5 18:40:44 2024 +0200

    * tp/Texinfo/Convert/Converter.pm (%XS_overrides, set_document),
    tp/Texinfo/XS/convert/ConvertXS.xs (converter_set_document): call
    call_common_set_output_perl_encoding in converter_set_document and
    override the whole set_document Perl function.
    
    * tp/Texinfo/XS/convert/ConvertXS.xs (html_conversion_initialization):
    call html_initialize_output_state without directly.
---
 ChangeLog                          | 10 ++++++++++
 tp/Texinfo/Convert/Converter.pm    | 18 +++++-------------
 tp/Texinfo/XS/convert/ConvertXS.xs | 19 +++++++++++--------
 3 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 59435b73a8..492b373cf6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-08-05  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Converter.pm (%XS_overrides, set_document),
+       tp/Texinfo/XS/convert/ConvertXS.xs (converter_set_document): call
+       call_common_set_output_perl_encoding in converter_set_document and
+       override the whole set_document Perl function.
+
+       * tp/Texinfo/XS/convert/ConvertXS.xs (html_conversion_initialization):
+       call html_initialize_output_state without directly.
+
 2024-08-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/ConvertXS.xs: reorder XS functions.
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 4c4854babb..091383586e 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -77,12 +77,12 @@ my %XS_overrides = (
    => "Texinfo::Convert::ConvertXS::force_conf",
   "Texinfo::Convert::Converter::_XS_get_conf"
    => "Texinfo::Convert::ConvertXS::get_conf",
-  "Texinfo::Convert::Converter::_XS_set_document"
-   => "Texinfo::Convert::ConvertXS::converter_set_document",
 
   # fully overriden for all the converters
   "Texinfo::Convert::Converter::_generic_converter_init",
    => "Texinfo::Convert::ConvertXS::generic_converter_init",
+  "Texinfo::Convert::Converter::set_document"
+   => "Texinfo::Convert::ConvertXS::converter_set_document",
   "Texinfo::Convert::Converter::get_converter_errors"
    => "Texinfo::Convert::ConvertXS::get_converter_errors",
   "Texinfo::Convert::Converter::converter_line_error"
@@ -237,25 +237,17 @@ sub output_internal_links($)
   return undef;
 }
 
-sub _XS_set_document($$)
-{
-}
-
 sub set_document($$)
 {
   my $converter = shift;
   my $document = shift;
 
-  if ($converter->{'converter_descriptor'}) {
-    _XS_set_document($converter, $document);
-  } else {
-    $converter->{'document'} = $document;
+  $converter->{'document'} = $document;
 
-    Texinfo::Common::set_output_encoding($converter, $document);
+  Texinfo::Common::set_output_encoding($converter, $document);
 
-    $converter->{'convert_text_options'}
+  $converter->{'convert_text_options'}
      = Texinfo::Convert::Text::copy_options_for_convert_text($converter);
-  }
 
   # In general, OUTPUT_PERL_ENCODING set below is needed for the output()
   # entry point through Texinfo::Convert::Utils::output_files_open_out.  It is
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 7b457973cd..0d3cae2bf2 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -46,6 +46,8 @@
 /* for command_location_names non_perl_free new_string_list ... */
 #include "utils.h"
 #include "command_stack.h"
+/* for call_common_set_output_perl_encoding */
+#include "call_perl_function.h"
 #include "document.h"
 #include "converter.h"
 #include "get_perl_info.h"
@@ -120,6 +122,7 @@ generic_converter_init (SV *converter_in, const char 
*class, SV *format_defaults
 
          pass_generic_converter_to_converter_sv (converter_in, self);
 
+# not called for HTML as the Perl function is called from overriden functions.
 void
 converter_set_document (SV *converter_in, SV *document_in)
       PREINIT:
@@ -130,6 +133,8 @@ converter_set_document (SV *converter_in, SV *document_in)
         self = converter_set_document_from_sv (converter_in, document_in);
         pass_document_to_converter_sv (self, converter_in, document_in);
 
+        call_common_set_output_perl_encoding (self);
+
 int
 set_conf (SV *converter_in, conf, SV *value)
          const char *conf = (char *)SvPVbyte_nolen($arg);
@@ -655,7 +660,7 @@ html_converter_defaults (SV *converter_in, SV *conf_sv)
 # allowing to override functions separately.
 # They are not actually called since output and convert are overriden.
 
-# called both in convert and output
+# called first both in convert and output
 void
 html_conversion_initialization (SV *converter_in, const char *context, SV 
*document_in=0)
       PREINIT:
@@ -664,13 +669,11 @@ html_conversion_initialization (SV *converter_in, const 
char *context, SV *docum
         /* if a converter is properly initialized, the XS converter should
            always be found when XS is used */
         self = converter_set_document_from_sv (converter_in, document_in);
-        if (self)
-          {
-            html_initialize_output_state (self, context);
-            /* could be useful if something from Perl is needed
-            html_conversion_initialization_sv (converter_in, self);
-             */
-          }
+
+        html_initialize_output_state (self, context);
+        /* could be useful if something from Perl is needed
+        html_conversion_initialization_sv (converter_in, self);
+        */
 
         html_pass_conversion_initialization (self, converter_in, document_in);
 



reply via email to

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