texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XSLoader.pm (init): call $module->im


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XSLoader.pm (init): call $module->import when falling back on pure perl module, not Texinfo::Parser->import.
Date: Sun, 26 Nov 2023 11:07:14 -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 adfd12141d * tp/Texinfo/XSLoader.pm (init): call $module->import when 
falling back on pure perl module, not Texinfo::Parser->import.
adfd12141d is described below

commit adfd12141d271b5f33f0ba0354b20b822f522099
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 26 17:07:06 2023 +0100

    * tp/Texinfo/XSLoader.pm (init): call $module->import when falling
    back on pure perl module, not Texinfo::Parser->import.
---
 ChangeLog              | 5 +++++
 tp/TODO                | 2 --
 tp/Texinfo/XSLoader.pm | 5 ++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 30a61c4a74..90d316e1a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-11-26  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XSLoader.pm (init): call $module->import when falling
+       back on pure perl module, not Texinfo::Parser->import.
+
 2023-11-26  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/DocumentXS.xs (gdt): update build_texinfo_tree
diff --git a/tp/TODO b/tp/TODO
index 414f6c61c3..99bec0b503 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,8 +10,6 @@ This is the todo list for texi2any
 Before next release
 ===================
 
-Texinfo::Parser->import hardcoded in Texinfo/XSLoader.pm
-
 check $(native_tools) variable in Makefile.am does not seems to be
 set and seems useless.
 
diff --git a/tp/Texinfo/XSLoader.pm b/tp/Texinfo/XSLoader.pm
index 9a1b722751..dbe5b94364 100644
--- a/tp/Texinfo/XSLoader.pm
+++ b/tp/Texinfo/XSLoader.pm
@@ -240,8 +240,11 @@ sub init {
   }
 
   # Fall back to using the Perl code.
+  # Note that if no import method can be found, then the call is skipped (this
+  # special case is described in perldoc use), therefore the fallback module
+  # does not need to implement import().
   # Use eval here to interpret :: properly in module name.
-  eval "require $fallback_module; Texinfo::Parser->import();";
+  eval "require $fallback_module; $module->import();";
   if ($@) {
     warn();
     die "Error loading $fallback_module\n";



reply via email to

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