[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Report.pm (format_line_message, line
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Report.pm (format_line_message, line_warn, line_error): add a bug message if error_location_info argument is undef. |
Date: |
Sun, 18 Feb 2024 10:08:48 -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 19883c39a4 * tp/Texinfo/Report.pm (format_line_message, line_warn,
line_error): add a bug message if error_location_info argument is undef.
19883c39a4 is described below
commit 19883c39a4a6784b31288ef044eeb9be65155d54
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 18 16:08:45 2024 +0100
* tp/Texinfo/Report.pm (format_line_message, line_warn, line_error):
add a bug message if error_location_info argument is undef.
---
ChangeLog | 5 +++++
tp/Texinfo/Convert/HTML.pm | 12 +++++-------
tp/Texinfo/Report.pm | 21 ++++++++++++++++-----
3 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 38e00535db..f9f35abe3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Report.pm (format_line_message, line_warn, line_error):
+ add a bug message if error_location_info argument is undef.
+
2024-02-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm: modify/remove FIXMEs.
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 38da7135d1..6ebab0e2e3 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -6560,7 +6560,7 @@ sub _convert_printindex_command($$$$)
}
$entry = '<code>' .$entry .'</code>' if ($in_code);
$delimiter = $self->get_conf('INDEX_ENTRY_COLON');
- # TODO add the information that the entry is associated with see
also?
+ # TODO add the information that the entry column is with see also?
$entry_class = "$cmdname-index-entry";
$section_class = "$cmdname-index-see-also";
}
@@ -8974,8 +8974,10 @@ sub converter_initialize($)
= $customized_special_unit_body->{$special_unit_variety};
}
- # TODO warn if the split specification is not one known? The main
- # program warns if the specific command line option value is not known.
+ # NOTE we reset silently if the split specification is not one known.
+ # The main program warns if the specific command line option value is
+ # not known. We could add a warning here to catch mistakes in init
+ # files. Wait for user reports.
if ($self->get_conf('SPLIT') and $self->get_conf('SPLIT') ne 'chapter'
and $self->get_conf('SPLIT') ne 'section'
and $self->get_conf('SPLIT') ne 'node') {
@@ -12398,10 +12400,6 @@ sub _prepare_converted_output_info($)
}
}
- # TODO it is not clear that a filename without line number is ok
- # for line_warn. Not clear what is the right way to do. There is
- # no file level warn, as in general document_warn is used for messages
- # for other files than the main file name.
if (defined($input_file_name)) {
$self->converter_line_warn(__(
"must specify a title with a title command or \@top"),
diff --git a/tp/Texinfo/Report.pm b/tp/Texinfo/Report.pm
index 0c997b7332..6af12df1d1 100644
--- a/tp/Texinfo/Report.pm
+++ b/tp/Texinfo/Report.pm
@@ -88,8 +88,10 @@ sub format_line_message($$$$;$)
my $continuation = shift;
my $warn = shift;
- # TODO actually a bug, add a bug message/cluck
- return if (!defined($error_location_info));
+ if (!defined($error_location_info)) {
+ cluck("BUG: format_line_message: error_location_info undef");
+ return;
+ }
my $message_line;
@@ -136,6 +138,11 @@ sub line_warn($$$$;$$)
my $continuation = shift;
my $silent = shift;
+ if (!defined($error_location_info)) {
+ cluck("BUG: line_warn: error_location_info undef");
+ return;
+ }
+
my $warn = (defined($configuration_information)
and $configuration_information->get_conf('DEBUG')
and not $silent);
@@ -154,6 +161,11 @@ sub line_error($$$$;$$)
my $continuation = shift;
my $silent = shift;
+ if (!defined($error_location_info)) {
+ cluck("BUG: line_error: error_location_info undef");
+ return;
+ }
+
my $warn = (defined($configuration_information)
and $configuration_information->get_conf('DEBUG')
and not $silent);
@@ -315,8 +327,7 @@ The text of the error.
=item error_line
-The text of the error formatted with the file name, line number and macro
-name, as needed.
+The text of the error formatted with the macro name, as needed.
=item line_nr
@@ -349,7 +360,7 @@ X<C<line_error>>
Register a warning or an error. The I<$text> is the text of the
error or warning. The I<$configuration_information> object gives
some information that can modify the messages or their delivery.
-The optional I<$error_location_info> holds the information on the error or
+The mandatory I<$error_location_info> holds the information on the error or
warning location. The I<$error_location_info> reference on hash may be
obtained from Texinfo elements I<source_info> keys. It may also
be setup to point to a file name, using the C<file_name> key and
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Report.pm (format_line_message, line_warn, line_error): add a bug message if error_location_info argument is undef.,
Patrice Dumas <=