texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Inverse meaning of handlers status. Re-add l2h ca


From: Patrice Dumas
Subject: branch master updated: Inverse meaning of handlers status. Re-add l2h cache
Date: Mon, 08 Aug 2022 06:19:58 -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 895425b561 Inverse meaning of handlers status. Re-add l2h cache
895425b561 is described below

commit 895425b5612fdeab16b7fd5aaff5595558ab56d3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Aug 8 12:19:36 2022 +0200

    Inverse meaning of handlers status. Re-add l2h cache
    
    * tp/Texinfo/Convert/HTML.pm (run_stage_handlers),
    tp/ext/epub3.pm, tp/ext/latex2html.pm, tp/ext/tex4ht.pm)
    (tp/init/book.pm, tp/init/chm.pm, tp/init/highlight_syntax.pm):
    inerse the meaning of handlers status, 0 means no error.
    
    * tp/ext/latex2html.pm (l2h_init_cache, l2h_store_cache):
    fix call to do and make %l2h_cache our such as it is available
    in the do.
    
    * tp/ext/latex2html.pm (l2h_finish_to_latex): do not call
    l2h_finish if $latex_count is 0, as it does nothing.
    
    * tp/texi2any.pl: add a comment.
---
 ChangeLog                                          |  18 ++++
 doc/customization_api.texi                         |   2 +-
 tp/TODO                                            |  10 +-
 tp/Texinfo/Convert/HTML.pm                         |  14 +--
 tp/ext/epub3.pm                                    |  42 ++++-----
 tp/ext/latex2html.pm                               | 101 +++++++++++++--------
 tp/ext/tex4ht.pm                                   |  14 +--
 tp/init/book.pm                                    |   2 +-
 tp/init/chm.pm                                     |  17 ++--
 tp/init/highlight_syntax.pm                        |  10 +-
 tp/init/html32.pm                                  |   2 +-
 .../encod\303\251/tex_complex-l2h_cache.pm"        |   1 +
 .../tex_encod\303\251_utf8-l2h_cache.pm"           |   1 +
 .../many_input_files/tex_l2h_res/tex-l2h_cache.pm  |   1 +
 .../tex_l2h_res/tex_complex-l2h_cache.pm           |   1 +
 .../block_EOL_tex/block_EOL-l2h_cache.pm           |   1 +
 .../formatting_singular/sing-l2h_cache.pm          |   1 +
 .../math_not_closed/math_not_closed-l2h_cache.pm   |   1 +
 tp/tests/tex_html/res_parser/tex/tex-l2h_cache.pm  |   1 +
 .../tex_accents_l2h/tex_accents-l2h_cache.pm       |   1 +
 .../tex_complex_l2h/tex_complex-l2h_cache.pm       |   1 +
 .../tex_encode_latin1-l2h_cache.pm                 |   1 +
 .../tex_encod\303\251_utf8-l2h_cache.pm"           |   1 +
 .../tex_eqalign_l2h/tex_eqalign-l2h_cache.pm       |   1 +
 .../res_parser/tex_gdef_l2h/tex_gdef-l2h_cache.pm  |   1 +
 .../tex_in_copying/tex_in_copying-l2h_cache.pm     |   1 +
 .../tex_not_closed/tex_not_closed-l2h_cache.pm     |   1 +
 tp/texi2any.pl                                     |   2 +
 28 files changed, 161 insertions(+), 89 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5bff1f64d7..d33566c40f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,24 @@
        * tp/Texinfo/Convert/LaTeX.pm (_convert) <def_item>:
        Avoid vertical space at beginning of 'quote' environment.
 
+2022-08-07  Patrice Dumas  <pertusus@free.fr>
+
+       Inverse meaning of handlers status. Re-add l2h cache
+
+       * tp/Texinfo/Convert/HTML.pm (run_stage_handlers),
+       tp/ext/epub3.pm, tp/ext/latex2html.pm, tp/ext/tex4ht.pm)
+       (tp/init/book.pm, tp/init/chm.pm, tp/init/highlight_syntax.pm):
+       inerse the meaning of handlers status, 0 means no error.
+
+       * tp/ext/latex2html.pm (l2h_init_cache, l2h_store_cache):
+       fix call to do and make %l2h_cache our such as it is available
+       in the do.
+
+       * tp/ext/latex2html.pm (l2h_finish_to_latex): do not call
+       l2h_finish if $latex_count is 0, as it does nothing.
+
+       * tp/texi2any.pl: add a comment.
+
 2022-08-07  Patrice Dumas  <pertusus@free.fr>
 
        Init file loading errors and warning interface setup and use
diff --git a/doc/customization_api.texi b/doc/customization_api.texi
index df14b16220..f2da3e3078 100644
--- a/doc/customization_api.texi
+++ b/doc/customization_api.texi
@@ -1848,7 +1848,7 @@ The call of the user defined functions is:
 @var{$converter} is a converter object. @var{\%tree} is the Texinfo
 tree root element. @var{$stage} is the current stage.
 
-If @var{$status} is false it means that an error occured.
+If @var{$status} is not 0 it means that an error occured.
 @end deftypefn
 
 
diff --git a/tp/TODO b/tp/TODO
index 31a7673d97..ad4fdbebd7 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -17,7 +17,7 @@ xterm &
 Before next release
 ===================
 
-LaTeX @example and similar, combine margins?
+LaTeX nested @example and similar, combine indentation if possible.
 
 Bugs
 ====
@@ -25,6 +25,14 @@ Bugs
 HTML API
 ========
 
+document Texinfo::Config
+texinfo_register_init_loading_error
+texinfo_register_init_loading_warning
+
+document Texinfo::Convert::HTML
+url_protect_file_text
+url_protect_url_text
+
 Issues
 ------
 
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index d380ce2a50..2b91baa358 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -9313,7 +9313,7 @@ sub run_stage_handlers($$$)
   my $stage = shift;
 
   my $stage_handlers = Texinfo::Config::GNUT_get_stage_handlers();
-  return 1 if (!defined($stage_handlers->{$stage}));
+  return 0 if (!defined($stage_handlers->{$stage}));
 
   my @sorted_priorities = sort keys(%{$stage_handlers->{$stage}});
   foreach my $priority (@sorted_priorities) {
@@ -9322,7 +9322,7 @@ sub run_stage_handlers($$$)
         print STDERR "HANDLER($stage) , priority $priority: $handler\n";
       }
       my $status = &{$handler}($converter, $root, $stage);
-      if (!$status) {
+      if ($status != 0) {
         #if ($converter->get_conf('VERBOSE')) {
         #  print STDERR "Handler $handler of $stage($priority) failed\n";
         #}
@@ -9333,7 +9333,7 @@ sub run_stage_handlers($$$)
       }
     }
   }
-  return 1;
+  return 0;
 }
 
 sub _reset_info()
@@ -9430,7 +9430,7 @@ sub output($$)
   $self->_reset_info();
 
   my $setup_status = $self->run_stage_handlers($root, 'setup');
-  return undef unless($setup_status);
+  return undef unless ($setup_status == 0);
 
   if ($self->get_conf('HTML_MATH')
         and $self->get_conf('HTML_MATH') eq 'mathjax') {
@@ -9530,7 +9530,7 @@ sub output($$)
   # run_stage_handlers.  Some information is not available yet.
   $self->_reset_info();
   my $structure_status = $self->run_stage_handlers($root, 'structure');
-  return undef unless($structure_status);
+  return undef unless ($structure_status == 0);
 
   my $default_document_language = $self->get_conf('documentlanguage');
 
@@ -9634,7 +9634,7 @@ sub output($$)
   $self->_reset_info();
 
   my $init_status = $self->run_stage_handlers($root, 'init');
-  return undef unless($init_status);
+  return undef unless ($init_status == 0);
 
   if ($self->get_conf('FRAMES')) {
     my $status = &{$self->formatting_function('format_frame_files')}($self,
@@ -9862,7 +9862,7 @@ sub output($$)
   }
 
   my $finish_status = $self->run_stage_handlers($root, 'finish');
-  return undef unless($finish_status);
+  return undef unless ($finish_status == 0);
 
   my $extension = '';
   $extension = '.'.$self->get_conf('EXTENSION')
diff --git a/tp/ext/epub3.pm b/tp/ext/epub3.pm
index 014ed14681..dde3dc5fcf 100644
--- a/tp/ext/epub3.pm
+++ b/tp/ext/epub3.pm
@@ -356,9 +356,9 @@ sub _epub_remove_container_folder($$)
                   $epub_destination_directory, $file, $message));
       }
     }
-    return 0;
+    return 1;
   }
-  return 1;
+  return 0;
 }
 
 my $epub_xhtml_dir = 'xhtml';
@@ -394,7 +394,7 @@ sub epub_setup($)
       and $archive_zip_loading_error) {
     $self->document_error($self,
        __("Archive::Zip is required for EPUB file output"));
-    return 0;
+    return 1;
   }
 
   if (not defined($self->get_conf('EPUB_KEEP_CONTAINER_FOLDER'))) {
@@ -471,7 +471,7 @@ sub epub_setup($)
 
   my $status = _epub_remove_container_folder($self,
                                        $encoded_epub_destination_directory);
-  return $status if (!$status);
+  return $status if ($status);
 
   my $err_make_path;
   my ($encoded_epub_document_destination_directory, 
$epub_doc_dest_dir_encoding)
@@ -492,9 +492,9 @@ sub epub_setup($)
                  $epub_document_destination_directory, $file, $message));
       }
     }
-    return 0;
+    return 1;
   }
-  return 1;
+  return 0;
 }
 
 texinfo_register_handler('setup', \&epub_setup);
@@ -523,7 +523,7 @@ sub epub_finish($$)
     $self->document_error($self, sprintf(__(
                    "could not create meta informations directory `%s': %s"),
                                          $meta_inf_directory, $!));
-    return 0;
+    return 1;
   }
   my $container_file_path_name = File::Spec->catfile($meta_inf_directory,
                                            'container.xml');
@@ -536,7 +536,7 @@ sub epub_finish($$)
     $self->document_error($self,
          sprintf(__("epub3.pm: could not open %s for writing: %s\n"),
                   $container_file_path_name, $!));
-    return 0;
+    return 1;
   }
   my $document_name = $self->get_info('document_name');
   my $opf_filename = $document_name . '.opf';
@@ -556,7 +556,7 @@ EOT
     $self->document_error($self,
          sprintf(__("epub3.pm: error on closing %s: %s"),
                           $container_file_path_name, $!));
-    return 0;
+    return 1;
   }
 
   my $mimetype_filename = 'mimetype';
@@ -571,7 +571,7 @@ EOT
     $self->document_error($self,
          sprintf(__("epub3.pm: could not open %s for writing: %s\n"),
                   $mimetype_file_path_name, $!));
-    return 0;
+    return 1;
   }
   # There is no end of line.  It is not very clear in the standard, but
   # example files demonstrate clearly that there should not be end of lines.
@@ -583,7 +583,7 @@ EOT
     $self->document_error($self,
          sprintf(__("epub3.pm: error on closing %s: %s"),
                           $mimetype_file_path_name, $!));
-    return 0;
+    return 1;
   }
   my $nav_id = 'nav';
   my $nav_file_path_name;
@@ -600,7 +600,7 @@ EOT
       $self->document_error($self,
            sprintf(__("epub3.pm: could not open %s for writing: %s\n"),
                     $nav_file_path_name, $!));
-      return 0;
+      return 1;
     }
     my $table_of_content_str = _epub_convert_tree_to_text($self,
                                              $self->gdt('Table of contents'));
@@ -679,7 +679,7 @@ EOT
       $self->document_error($self,
            sprintf(__("epub3.pm: error on closing %s: %s"),
                             $nav_file_path_name, $!));
-      return 0;
+      return 1;
     }
   }
 
@@ -708,7 +708,7 @@ EOT
     $self->document_error($self,
          sprintf(__("epub3.pm: could not open %s for writing: %s\n"),
                   $opf_file_path_name, $!));
-    return 0;
+    return 1;
   }
   print $opf_fh <<EOT;
 <?xml version="1.0" encoding="UTF-8"?>
@@ -861,7 +861,7 @@ EOT
     $self->document_error($self,
          sprintf(__("epub3.pm: error on closing %s: %s"),
                           $opf_file_path_name, $!));
-    return 0;
+    return 1;
   }
 
   if ($self->get_conf('EPUB_CREATE_CONTAINER_FILE')) {
@@ -881,7 +881,7 @@ EOT
       $self->document_error($self,
         sprintf(__("epub3.pm: error adding %s to archive"),
                $mimetype_file_path_name));
-      return 0;
+      return 1;
     }
 
     my $meta_inf_directory_ret_code
@@ -890,7 +890,7 @@ EOT
       $self->document_error($self,
         sprintf(__("epub3.pm: error adding %s to archive"),
                $meta_inf_directory));
-      return 0;
+      return 1;
     }
 
     my $epub_document_dir_path = 
File::Spec->catdir($epub_destination_directory,
@@ -903,7 +903,7 @@ EOT
       $self->document_error($self,
         sprintf(__("epub3.pm: error adding %s to archive"),
                $epub_document_dir_path));
-      return 0;
+      return 1;
     }
 
     my ($encoded_epub_outfile, $epub_outfile_encoding)
@@ -912,16 +912,16 @@ EOT
       $self->document_error($self,
            sprintf(__("epub3.pm: error writing archive %s"),
                    $epub_outfile));
-      return 0;
+      return 1;
     }
   }
 
   if (not $self->get_conf('EPUB_KEEP_CONTAINER_FOLDER')) {
     my $status = _epub_remove_container_folder($self,
                                        $encoded_epub_destination_directory);
-    return $status if (!$status);
+    return $status if ($status);
   }
-  return 1;
+  return 0;
 }
 
 texinfo_register_handler('finish', \&epub_finish);
diff --git a/tp/ext/latex2html.pm b/tp/ext/latex2html.pm
index dcdd654f93..5da885b0b6 100644
--- a/tp/ext/latex2html.pm
+++ b/tp/ext/latex2html.pm
@@ -83,9 +83,9 @@ texinfo_set_from_init_file('L2H_CLEAN', 1);
 my ($l2h_name, $l2h_latex_path_name, $l2h_latex_path_string, 
$l2h_cache_path_name,
     $l2h_html_path_name, $l2h_html_path_string, $l2h_prefix, 
$l2h_prefix_string);
 
-# holds the status of latex2html operations. If 0 it means that there was
-# an error
-my $status = 0;
+# holds the status of latex2html operations. If > 0 it means that there was
+# an error, if < 0, means that there is nothing to do
+my $status;
 
 my $debug;
 my $verbose;
@@ -135,7 +135,9 @@ my $latex_count = 0;           # number of latex texts 
really stored
 my $latex_converted_count = 0; # number of latex texts passed through 
latex2html
 my $to_latex_count = 0;        # total number of latex texts processed
 my $cached_count = 0;          # number of cached latex texts
-my %l2h_cache = ();            # the cache hash. Associate latex text with
+# need to be our, as in the do that loads the cache, the file lexicals
+# are not visible
+our %l2h_cache = ();           # the cache hash. Associate latex text with
                                # html from the previous run
 my @l2h_from_html;             # array of resulting html
 
@@ -143,7 +145,7 @@ my %global_count = ();         # associate a command name 
and the
                                # corresponding counter to the index in the
                                # html result array
 
-# set $status to 1, if l2h could be initalized properly, to 0 otherwise
+# set $status to 0, if l2h could be initalized properly
 sub l2h_process($$)
 {
   my $self = shift;
@@ -171,8 +173,8 @@ sub l2h_process($$)
   $image_count = 1;
 
   $html_output_count = 0;   # html text outputed in html result file
-  $status = 0;
-  return if (defined($self->get_conf('OUTFILE'))
+  $status = 1;
+  return -1 if (defined($self->get_conf('OUTFILE'))
         and $Texinfo::Common::null_device_file{$self->get_conf('OUTFILE')});
 
   $docu_name = $self->get_info('document_name');
@@ -216,8 +218,8 @@ sub l2h_process($$)
       $self->document_error($self, sprintf(__(
               "l2h: could not open latex file %s for writing: %s"),
                                     $l2h_latex_path_name, $!));
-      $status = 0;
-      return;
+      $status = 1;
+      return 1;
     }
     # according to the .log file latex2html is expecting utf-8 if no 
information
     # is provided
@@ -258,15 +260,17 @@ sub l2h_process($$)
     }
   }
   $status = l2h_finish_to_latex($self);
-  if ($status) {
+  if ($status == 0) {
     $status = l2h_to_html($self);
   }
-  if ($status) {
+  if ($status == 0) {
     $status = l2h_init_from_html($self);
   }
-  # FIXME use $status?  That is abort when something goes wrong on the
-  # latex2html front?
-  return 1;
+  if ($status <= 0) {
+    return 0;
+  } else {
+    return -$status;
+  }
 }
 
 
@@ -317,7 +321,6 @@ sub l2h_to_latex($$$$)
     $l2h_to_latex{$text} = $count;
   }
   $global_count{"${command}_$counter"} = $count;
-  return 1;
 }
 
 # print closing into latex file and close it
@@ -327,15 +330,15 @@ sub l2h_finish_to_latex($)
   my $reused = $to_latex_count - $latex_converted_count - $cached_count;
   unless ($self->get_conf('L2H_SKIP')) {
     print L2H_LATEX $l2h_latex_closing;
+    # FIXME error condition not checked
     close (L2H_LATEX);
   }
   warn "# l2h: finished to latex ($cached_count cached, $reused reused, 
$latex_converted_count to process)\n" if ($verbose);
-  unless ($latex_count) {
-    # no @tex nor @math
-    l2h_finish($self);
-    return 0;
+  if ($latex_count == 0) {
+    # no @tex nor @math at all, nothing to do
+    return -1;
   }
-  return 1;
+  return 0;
 }
 
 ###################################
@@ -355,7 +358,7 @@ sub l2h_to_html($)
   # comes from the cache), there is no latex2html run
   if ($self->get_conf('L2H_SKIP') or ($latex_converted_count == 0)) {
      warn "# l2h: skipping latex2html run\n" if ($verbose);
-     return 1;
+     return 0;
   }
   # Check for dot in directory where dvips will work
   if ($self->get_conf('L2H_TMP')) {
@@ -371,12 +374,12 @@ sub l2h_to_html($)
       $dotbug = 1;
     }
   }
-  return 0 if ($dotbug);
+  #return 1 if ($dotbug);
 
   my $latex2html_command = $self->get_conf('L2H_L2H');
   if (not defined($latex2html_command) or $latex2html_command !~ /\S/) {
     $self->document_error($self, __("l2h: command not set"));
-    return 0;
+    return 1;
   }
   # the final call is obtained by concatenating $call_start encoded
   # and strings based on already encoded file paths.
@@ -428,10 +431,10 @@ sub l2h_to_html($)
   if (system($encoded_call)) {
     $self->document_error($self, sprintf(__("l2h: command did not succeed: 
%s"),
                                          $call));
-    return 0;
+    return 1;
   } else  {
     warn "# l2h: latex2html finished successfully\n" if ($verbose);
-    return 1;
+    return 0;
   }
 }
 
@@ -522,14 +525,14 @@ sub l2h_init_from_html($)
   # comes from the cache), the html file that was generated by previous
   # latex2html runs isn't reused.
   if ($latex_converted_count == 0) {
-    return 1;
+    return 0;
   }
 
   if (! open(L2H_HTML, "<$l2h_html_path_string")) {
     $self->document_warn($self,
                 sprintf(__("l2h: could not open %s: %s"),
                                  $l2h_html_path_name, $!));
-    return 0;
+    return 1;
   }
   # the file content is UTF-8 encoded
   binmode(L2H_HTML, ':utf8');
@@ -566,7 +569,7 @@ sub l2h_init_from_html($)
                 sprintf(__("latex2html.pm: end of \@%s item %d not found"),
                                       $l2h_name, $count));
         close(L2H_HTML);
-        return 0;
+        return 1;
       }
     }
   }
@@ -582,7 +585,7 @@ sub l2h_init_from_html($)
     if ($verbose);
 
   close(L2H_HTML);
-  return 1;
+  return 0;
 }
 
 # $html_output_count = 0;   # html text outputed in html result file
@@ -598,7 +601,7 @@ sub l2h_do_tex($$$;$$)
   my $content = shift;
 
   my $counter = $commands_counters{$command};
-  return '' unless ($status);
+  return '' unless ($status == 0);
   my $count = $global_count{"${cmdname}_$counter"};
   ################################## begin debug section (incorrect counts)
   if (!defined($count)) {
@@ -646,7 +649,8 @@ sub l2h_do_tex($$$;$$)
 sub l2h_finish($)
 {
   my $self = shift;
-  return 1 unless($status);
+  # return immediately if nothing to do or an error
+  return 0 unless ($status == 0);
 
   if ($verbose) {
     if ($extract_error_count + $invalid_counter_count) {
@@ -680,7 +684,7 @@ sub l2h_finish($)
     }
   }
   warn "# l2h: Finished\n" if $verbose;
-  return 1;
+  return 0;
 }
 
 ##############################
@@ -697,12 +701,33 @@ sub l2h_init_cache($)
   my ($encoded_l2h_cache_path_name, $l2h_cache_path_encoding)
     = $self->encoded_output_file_name($l2h_cache_path_name);
   if (-r $encoded_l2h_cache_path_name) {
-    my $rdo = do "$encoded_l2h_cache_path_name";
-    $self->document_error($self,
-               sprintf(__("l2h: could not load %s: %s"),
+    my $loaded_path;
+    # do require a relative path, or to have . in INC
+    if (not File::Spec->file_name_is_absolute($l2h_cache_path_name)) {
+      $loaded_path = File::Spec->catfile(File::Spec->curdir(),
+                                       $encoded_l2h_cache_path_name);
+    } else {
+      $loaded_path = $encoded_l2h_cache_path_name;
+    }
+    my $rdo = do "$loaded_path";
+    unless ($rdo) {
+      # FIXME error or warning?
+      $self->document_error($self,
+               sprintf(__("l2h: could not compile %s: %s"),
                                   $l2h_cache_path_name, $@))
-      unless ($rdo);
+        if ($@);
+      if (! defined($rdo)) {
+        $self->document_error($self,
+               sprintf(__("l2h: could not load %s: %s"),
+                                  $l2h_cache_path_name, $!));
+      } else {
+        $self->document_error($self,
+               sprintf(__("l2h: error loading %s"),
+                                   $l2h_cache_path_name));
+      }
+    }
   }
+  warn "# l2h: Cached: ".join('|', sort(keys(%l2h_cache)))."\n" if $verbose;
 }
 
 # store all the text obtained through latex2html
@@ -722,6 +747,7 @@ sub l2h_store_cache($)
   binmode(FH, ':utf8');
 
   print FH "# Automatically generated\nuse utf8;\n";
+  print FH "our %l2h_cache;\n";
 
   foreach my $key(sort(keys(%l2h_cache))) {
     my $value = $l2h_cache{$key};
@@ -737,7 +763,10 @@ sub l2h_store_cache($)
     print FH "\n\$l2h_cache_key = q/$key/;\n";
     print FH "\$l2h_cache{\$l2h_cache_key} = q|$value|;\n";
   }
+  print FH 'warn "# cache: Cached: ".join("|", 
sort(keys(%l2h_cache)))."\n"'.";\n"
+    if ($verbose);
   print FH "\n1;\n";
+  # FIXME error condition not checked
   close(FH);
 }
 
diff --git a/tp/ext/tex4ht.pm b/tp/ext/tex4ht.pm
index e969e8992c..3044f2dc26 100644
--- a/tp/ext/tex4ht.pm
+++ b/tp/ext/tex4ht.pm
@@ -93,7 +93,7 @@ sub tex4ht_prepare($$)
   my $self = shift;
   my $document_root = shift;
 
-  return 1 if (defined($self->get_conf('OUTFILE'))
+  return -1 if (defined($self->get_conf('OUTFILE'))
         and $Texinfo::Common::null_device_file{$self->get_conf('OUTFILE')});
 
   $tex4ht_initial_dir = Cwd::abs_path;
@@ -218,7 +218,7 @@ sub tex4ht_prepare($$)
           $before_comment_close = "\\HCode{\\Hnewline ";
           $after_comment_close = "\\Hnewline \\Hnewline}\n";
         }
-  
+
         my $begin_comment = "<!-- tex4ht_begin $formats{$format}->{'basename'} 
$command $counter -->";
         print $fh "$before_comment_open$begin_comment$after_comment_open";
         if ($command eq 'tex') {
@@ -250,7 +250,7 @@ sub tex4ht_prepare($$)
                     "\@import \"$formats{$format}->{'basename'}.css\";\n");
     }
   }
-  return 1;
+  return 0;
 }
 
 sub tex4ht_convert($)
@@ -262,7 +262,7 @@ sub tex4ht_convert($)
     $self->document_warn($self,
             sprintf(__("tex4ht.pm: chdir %s failed: %s"),
                          $tex4ht_out_dir, $!));
-    return 0;
+    return 1;
   }
   print STDERR "cwd($encoded_tex4ht_out_dir): " . Cwd::cwd() ."\n"
     if ($self->get_conf('VERBOSE'));
@@ -274,9 +274,9 @@ sub tex4ht_convert($)
   unless (chdir $tex4ht_initial_dir) {
     $self->document_warn($self, sprintf(__(
           "tex4ht.pm: unable to return to initial directory: %s"), $!));
-    return 0;
+    return 1;
   }
-  return 1;
+  return 0;
 }
 
 sub tex4ht_process_format($$) {
@@ -424,7 +424,7 @@ sub tex4ht_finish($)
       }
     }
   }
-  return 1;
+  return 0;
 }
 
 1;
diff --git a/tp/init/book.pm b/tp/init/book.pm
index 7ea33cd92a..6b171194ad 100644
--- a/tp/init/book.pm
+++ b/tp/init/book.pm
@@ -64,7 +64,7 @@ sub book_init($)
   $book_previous_default_filename = undef;
   $book_previous_file_name = undef;
   $book_unumbered_nr = 0;
-  return 1;
+  return 0;
 }
 
 texinfo_register_handler('init', \&book_init);
diff --git a/tp/init/chm.pm b/tp/init/chm.pm
index 595eeb1743..8c2e0d9736 100644
--- a/tp/init/chm.pm
+++ b/tp/init/chm.pm
@@ -207,7 +207,7 @@ sub _chm_convert_tree_to_text($$;$)
 sub chm_init($)
 {
   my $self = shift;
-  return if (defined($self->get_conf('OUTFILE'))
+  return -1 if (defined($self->get_conf('OUTFILE'))
         and $Texinfo::Common::null_device_file{$self->get_conf('OUTFILE')});
   my $document_name = $self->get_info('document_name');
   my $outdir = $self->get_info('destination_directory');
@@ -224,7 +224,7 @@ sub chm_init($)
     $self->document_error($self,
          sprintf(__("chm.pm: could not open %s for writing: %s\n"), 
                   $hhk_file_path_name, $!));
-    return 0;
+    return 1;
   }
   print STDERR "# writing HTML Help index in $hhk_file_path_name...\n" 
      if ($self->get_conf('VERBOSE'));
@@ -260,7 +260,7 @@ sub chm_init($)
     $self->document_error($self,
            sprintf(__("chm.pm: error on closing %s: %s"),
                           $hhk_file_path_name, $!));
-    return 0;
+    return 1;
   }
 
   my $hhc_filename = $document_name . ".hhc";
@@ -275,7 +275,7 @@ sub chm_init($)
     $self->document_error($self,
          sprintf(__("chm.pm: could not open %s for writing: %s\n"), 
                   $hhc_file_path_name, $!));
-    return 0;
+    return 1;
   }
 
   print STDERR "# writing HTML Help project in $hhc_file_path_name...\n" 
@@ -288,7 +288,6 @@ sub chm_init($)
   print $hhc_fh "<OBJECT type=\"text/site properties\">\n";
   foreach my $property (sort(keys(%hhc_global_property))) {
     print $hhc_fh "<param name=\"$property\" 
value=\"$hhc_global_property{$property}\">\n";
-      
   }
   print $hhc_fh "</OBJECT>\n";
 
@@ -338,7 +337,7 @@ sub chm_init($)
     $self->document_error($self,
            sprintf(__("chm.pm: error on closing %s: %s"),
                           $hhc_file_path_name, $!));
-    return 0;                  
+    return 1;
   }
 
   my $hhp_filename = $document_name . ".hhp";
@@ -353,7 +352,7 @@ sub chm_init($)
     $self->document_error(
            $self, sprintf(__("chm.pm: could not open %s for writing: %s\n"), 
                   $hhp_file_path_name, $!));
-    return 0;
+    return 1;
   }
   print STDERR "# writing HTML Help project in $hhp_file_path_name...\n" 
      if ($self->get_conf('VERBOSE'));
@@ -405,10 +404,10 @@ EOT
     $self->document_error($self,
          sprintf(__("chm.pm: error on closing %s: %s"),
                           $hhp_file_path_name, $!));
-    return 0;                  
+    return 1;
   }
 
-  return 1;
+  return 0;
 }
 texinfo_register_handler('init', \&chm_init);
 
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index 3d5a3a09f6..6063a9527d 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -136,7 +136,7 @@ sub highlight_process($$)
   my $self = shift;
   my $document_root = shift;
 
-  return 1 if (defined($self->get_conf('OUTFILE'))
+  return -1 if (defined($self->get_conf('OUTFILE'))
         and $Texinfo::Common::null_device_file{$self->get_conf('OUTFILE')});
 
   my $document_name = $self->get_info('document_name');
@@ -190,7 +190,7 @@ sub highlight_process($$)
       $self->document_warn($self,
              sprintf(__("highlight_syntax.pm: could not open %s: %s"),
                                       $input_language_path_name, $!));
-      return 0;
+      return 1;
     }
     my $output_encoding;
     if (defined($self->get_conf('OUTPUT_PERL_ENCODING'))) {
@@ -253,7 +253,7 @@ sub highlight_process($$)
       $self->document_error($self,
           sprintf(__("highlight_syntax.pm: command did not succeed: %s"),
                                   $cmd));
-      return 0;
+      return 1;
     }
 
     my $language_fragments_nr = $languages{$language}->{'counter'};
@@ -264,7 +264,7 @@ sub highlight_process($$)
       $self->document_warn($self,
          sprintf(__("highlight_syntax.pm: could not open %s: %s"),
                                   $html_result_path_name, $!));
-      return 0;
+      return 1;
     }
     binmode(HIGHLIGHT_LANG_OUT, ":encoding($output_encoding)")
       if (defined($output_encoding));
@@ -314,7 +314,7 @@ sub highlight_process($$)
     }
     close (HIGHLIGHT_LANG_OUT);
   }
-  return 1;
+  return 0;
 }
 
 sub highlight_preformatted_command($$$$$)
diff --git a/tp/init/html32.pm b/tp/init/html32.pm
index 58a571b6fc..c45cc98cc8 100644
--- a/tp/init/html32.pm
+++ b/tp/init/html32.pm
@@ -105,7 +105,7 @@ sub html32_setup($)
   if (defined($self->get_conf('TEXI2HTML'))) {
     $self->set_conf('BIG_RULE', '<hr size="6">');
   }
-  return 1;
+  return 0;
 }
 
 
diff --git 
"a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_complex-l2h_cache.pm"
 
"b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_complex-l2h_cache.pm"
index e030aff657..43270c0837 100644
--- 
"a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_complex-l2h_cache.pm"
+++ 
"b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_complex-l2h_cache.pm"
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
  U w V^\dagger
diff --git 
"a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_encod\303\251_utf8-l2h_cache.pm"
 
"b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_encod\303\251_utf8-l2h_cache.pm"
index 5b1e91b34a..0a39189a25 100644
--- 
"a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_encod\303\251_utf8-l2h_cache.pm"
+++ 
"b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii_res/encod\303\251/tex_encod\303\251_utf8-l2h_cache.pm"
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
 é \partial_{\eta} g(\eta(t),\varphi(t));
diff --git a/tp/tests/many_input_files/tex_l2h_res/tex-l2h_cache.pm 
b/tp/tests/many_input_files/tex_l2h_res/tex-l2h_cache.pm
index 08f5302dec..eca1ff9208 100644
--- a/tp/tests/many_input_files/tex_l2h_res/tex-l2h_cache.pm
+++ b/tp/tests/many_input_files/tex_l2h_res/tex-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/
 $$ \chi^2 = \sum_{i=1}^N
diff --git a/tp/tests/many_input_files/tex_l2h_res/tex_complex-l2h_cache.pm 
b/tp/tests/many_input_files/tex_l2h_res/tex_complex-l2h_cache.pm
index e030aff657..43270c0837 100644
--- a/tp/tests/many_input_files/tex_l2h_res/tex_complex-l2h_cache.pm
+++ b/tp/tests/many_input_files/tex_l2h_res/tex_complex-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
  U w V^\dagger
diff --git a/tp/tests/tex_html/res_parser/block_EOL_tex/block_EOL-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/block_EOL_tex/block_EOL-l2h_cache.pm
index 7fe15d8a88..128f48e6ce 100644
--- a/tp/tests/tex_html/res_parser/block_EOL_tex/block_EOL-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/block_EOL_tex/block_EOL-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/Surrounded by empty lines./;
 $l2h_cache{$l2h_cache_key} = q|Surrounded by empty lines.|;
diff --git a/tp/tests/tex_html/res_parser/formatting_singular/sing-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/formatting_singular/sing-l2h_cache.pm
index 1cdb34d4e9..dce9d425fd 100644
--- a/tp/tests/tex_html/res_parser/formatting_singular/sing-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/formatting_singular/sing-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$@"u @"{U} @~n @^a @'e @=o @`i @'{e} @`{@=E}
 @,{@'C} @,{@'C} @H{a} @dotaccent{a} @ringaccent{a} @tieaccent{a}
diff --git 
a/tp/tests/tex_html/res_parser/math_not_closed/math_not_closed-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/math_not_closed/math_not_closed-l2h_cache.pm
index 371b5968ea..4f9a2c1180 100644
--- a/tp/tests/tex_html/res_parser/math_not_closed/math_not_closed-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/math_not_closed/math_not_closed-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$3\delta + 2
 $/;
diff --git a/tp/tests/tex_html/res_parser/tex/tex-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex/tex-l2h_cache.pm
index 08f5302dec..eca1ff9208 100644
--- a/tp/tests/tex_html/res_parser/tex/tex-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex/tex-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/
 $$ \chi^2 = \sum_{i=1}^N
diff --git 
a/tp/tests/tex_html/res_parser/tex_accents_l2h/tex_accents-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_accents_l2h/tex_accents-l2h_cache.pm
index 4426ac5be8..5ccaee0d22 100644
--- a/tp/tests/tex_html/res_parser/tex_accents_l2h/tex_accents-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_accents_l2h/tex_accents-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/T\'et/;
 $l2h_cache{$l2h_cache_key} = q|Tét|;
diff --git 
a/tp/tests/tex_html/res_parser/tex_complex_l2h/tex_complex-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_complex_l2h/tex_complex-l2h_cache.pm
index e030aff657..43270c0837 100644
--- a/tp/tests/tex_html/res_parser/tex_complex_l2h/tex_complex-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_complex_l2h/tex_complex-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
  U w V^\dagger
diff --git 
a/tp/tests/tex_html/res_parser/tex_encoded_latin1_l2h/tex_encode_latin1-l2h_cache.pm
 
b/tp/tests/tex_html/res_parser/tex_encoded_latin1_l2h/tex_encode_latin1-l2h_cache.pm
index d1ca0078a9..c8dae60cdb 100644
--- 
a/tp/tests/tex_html/res_parser/tex_encoded_latin1_l2h/tex_encode_latin1-l2h_cache.pm
+++ 
b/tp/tests/tex_html/res_parser/tex_encoded_latin1_l2h/tex_encode_latin1-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
 é \partial_{\eta} g(\eta(t),\varphi(t));
diff --git 
"a/tp/tests/tex_html/res_parser/tex_encoded_utf8_l2h/tex_encod\303\251_utf8-l2h_cache.pm"
 
"b/tp/tests/tex_html/res_parser/tex_encoded_utf8_l2h/tex_encod\303\251_utf8-l2h_cache.pm"
index 5b1e91b34a..0a39189a25 100644
--- 
"a/tp/tests/tex_html/res_parser/tex_encoded_utf8_l2h/tex_encod\303\251_utf8-l2h_cache.pm"
+++ 
"b/tp/tests/tex_html/res_parser/tex_encoded_utf8_l2h/tex_encod\303\251_utf8-l2h_cache.pm"
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
 é \partial_{\eta} g(\eta(t),\varphi(t));
diff --git 
a/tp/tests/tex_html/res_parser/tex_eqalign_l2h/tex_eqalign-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_eqalign_l2h/tex_eqalign-l2h_cache.pm
index d2ff162094..d774ed7ff8 100644
--- a/tp/tests/tex_html/res_parser/tex_eqalign_l2h/tex_eqalign-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_eqalign_l2h/tex_eqalign-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$\leqalignno{
    \int v(t)\, dt &= u(t) + C&[3.1]\cr
diff --git a/tp/tests/tex_html/res_parser/tex_gdef_l2h/tex_gdef-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_gdef_l2h/tex_gdef-l2h_cache.pm
index 4a59f3b663..975c241ba3 100644
--- a/tp/tests/tex_html/res_parser/tex_gdef_l2h/tex_gdef-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_gdef_l2h/tex_gdef-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/  \gdef\Desig{\buildrel \rm def \over \equiv}/;
 $l2h_cache{$l2h_cache_key} = q|  |;
diff --git 
a/tp/tests/tex_html/res_parser/tex_in_copying/tex_in_copying-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_in_copying/tex_in_copying-l2h_cache.pm
index 4c9c75dab6..52d657781c 100644
--- a/tp/tests/tex_html/res_parser/tex_in_copying/tex_in_copying-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_in_copying/tex_in_copying-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/$$
 2 a = \dot{\phi}
diff --git 
a/tp/tests/tex_html/res_parser/tex_not_closed/tex_not_closed-l2h_cache.pm 
b/tp/tests/tex_html/res_parser/tex_not_closed/tex_not_closed-l2h_cache.pm
index 8277223323..3a66cf6a02 100644
--- a/tp/tests/tex_html/res_parser/tex_not_closed/tex_not_closed-l2h_cache.pm
+++ b/tp/tests/tex_html/res_parser/tex_not_closed/tex_not_closed-l2h_cache.pm
@@ -1,5 +1,6 @@
 # Automatically generated
 use utf8;
+our %l2h_cache;
 
 $l2h_cache_key = q/
 This is some \LaTeX{}/;
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 7c1d553687..13770fe0b1 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -564,6 +564,7 @@ my %formats_table = (
              'split' => 1,
              'internal_links' => 1,
              'simple_menu' => 1,
+  # move_index_entries_after_items + relate_index_entries_to_table_entries
              'joint_transformation' => 1,
              'no_warn_non_empty_parts' => 1,
              'module' => 'Texinfo::Convert::HTML'
@@ -1459,6 +1460,7 @@ while(@input_files) {
     Texinfo::Common::relate_index_entries_to_table_entries_in_tree($tree);
   }
 
+  # move_index_entries_after_items + relate_index_entries_to_table_entries
   if ($formats_table{$converted_format}->{'joint_transformation'}) {
     Texinfo::Common::html_joint_transformation($tree);
   }



reply via email to

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