[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_erro
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_error_registrar) (parse_texi_file, _get_errors): setup an error registrar to output the error message obtained before tree parsing. |
Date: |
Thu, 02 Sep 2021 05:43:16 -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 1c99573 * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_error_registrar)
(parse_texi_file, _get_errors): setup an error registrar to output the error
message obtained before tree parsing.
1c99573 is described below
commit 1c9957350cda83e3096f20e712c258b06a2360d5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Sep 2 11:43:01 2021 +0200
* tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_error_registrar)
(parse_texi_file, _get_errors): setup an error registrar
to output the error message obtained before tree parsing.
* tp/init/latex2html.pm (l2h_to_html): check that the
command is set.
---
ChangeLog | 9 +++++++++
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 20 ++++++++++++++------
tp/init/latex2html.pm | 13 +++++++++----
3 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 82f6158..c8a6b6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2021-09-02 Patrice Dumas <pertusus@free.fr>
+ * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_error_registrar)
+ (parse_texi_file, _get_errors): setup an error registrar
+ to output the error message obtained before tree parsing.
+
+ * tp/init/latex2html.pm (l2h_to_html): check that the
+ command is set.
+
+2021-09-02 Patrice Dumas <pertusus@free.fr>
+
* tp/Texinfo/Convert/Converter.pm (converter_global_commands),
tp/Texinfo/Convert/HTML.pm (output):
handle the global unique commands similarly with the global
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 76edf14..d7011ea 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -166,6 +166,17 @@ sub _associate_node_menus {
}
}
+sub _get_error_registrar($)
+{
+ my $self = shift;
+ if (not $self->{'registrar'}) {
+ $self->{'registrar'} = Texinfo::Report::new();
+ }
+ my $registrar = $self->{'registrar'};
+ my $configuration_informations = $self;
+ return $registrar, $configuration_informations;
+}
+
sub get_parser_info {
my $self = shift;
@@ -250,7 +261,8 @@ sub parse_texi_file ($$)
my $status = parse_file ($file_name);
if ($status) {
- $self->document_error($self,
+ my ($registrar, $configuration_informations) = _get_error_registrar($self);
+ $registrar->document_error($configuration_informations,
sprintf(__("could not open %s: %s"), $file_name, $!));
return undef;
}
@@ -285,11 +297,7 @@ sub parse_texi_file ($$)
sub _get_errors($)
{
my $self = shift;
- if (not $self->{'registrar'}) {
- $self->{'registrar'} = Texinfo::Report::new();
- }
- my $registrar = $self->{'registrar'};
- my $configuration_informations = $self;
+ my ($registrar, $configuration_informations) = _get_error_registrar($self);
my $ERRORS;
my $tree_stream = dump_errors();
diff --git a/tp/init/latex2html.pm b/tp/init/latex2html.pm
index 7444d58..92b35d7 100644
--- a/tp/init/latex2html.pm
+++ b/tp/init/latex2html.pm
@@ -352,10 +352,15 @@ sub l2h_to_html($)
}
return 0 if ($dotbug);
- $call = $self->get_conf('L2H_L2H');
+ 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;
+ }
+ $call = $latex2html_command;
# use init file, if specified
my $init_file = $self->get_conf('L2H_FILE');
- $call = $call . " -init_file " . $init_file
+ $call .= " -init_file " . $init_file
if (defined($init_file) and $init_file ne ''
and -f $init_file and -r $init_file);
# set output dir
@@ -379,8 +384,8 @@ sub l2h_to_html($)
$call));
return 0;
} else {
- warn "# l2h: latex2html finished successfully\n" if ($verbose);
- return 1;
+ warn "# l2h: latex2html finished successfully\n" if ($verbose);
+ return 1;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_error_registrar) (parse_texi_file, _get_errors): setup an error registrar to output the error message obtained before tree parsing.,
Patrice Dumas <=