[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 26 Jan 2024 06:36:17 -0500 (EST) |
branch: master
commit cbd2bb89678f94f3c303d9fc50681e0dbbcd5947
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jan 26 12:36:03 2024 +0100
* tp/Texinfo/options_data.txt, tp/texi2any.pl: add customization
variable SHOW_INCLUDE_FILE_PATHS with which included file paths are
output.
* tp/texi2any.pl: remove document even when there is no conversion, but
parse, structure, dump or similar.
---
ChangeLog | 9 +++++++++
tp/TODO | 3 +++
tp/Texinfo/options_data.txt | 1 +
tp/texi2any.pl | 22 +++++++++++++++++-----
4 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9ec469043c..4dab9420fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-26 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/options_data.txt, tp/texi2any.pl: add customization
+ variable SHOW_INCLUDE_FILE_PATHS with which included file paths are
+ output.
+
+ * tp/texi2any.pl: remove document even when there is no conversion, but
+ parse, structure, dump or similar.
+
2024-01-26 Patrice Dumas <pertusus@free.fr>
Gather include file paths in document global information
diff --git a/tp/TODO b/tp/TODO
index f2197e999a..9a7eec76d3 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,6 +10,9 @@ This is the todo list for texi2any
Before next release
===================
+Ask on mailing list what the interface to include paths list should
+be. Depending on the issue, document SHOW_INCLUDE_FILE_PATHS.
+
Bugs
====
diff --git a/tp/Texinfo/options_data.txt b/tp/Texinfo/options_data.txt
index 09a148b61d..8bb41e7d36 100644
--- a/tp/Texinfo/options_data.txt
+++ b/tp/Texinfo/options_data.txt
@@ -156,6 +156,7 @@ CHECK_MISSING_MENU_ENTRY program_customization 1
integer
DUMP_TREE program_customization undef integer
DUMP_TEXI program_customization undef integer
SHOW_BUILTIN_CSS_RULES program_customization 0 integer
+SHOW_INCLUDE_FILE_PATHS program_customization 0 integer
SORT_ELEMENT_COUNT program_customization undef char
SORT_ELEMENT_COUNT_WORDS program_customization undef integer
TEXI2DVI program_customization texi2dvi char
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 30d525c486..2e07676843 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1502,7 +1502,19 @@ while(@input_files) {
my $registrar = $parser->registered_errors();
if (!defined($tree) or $format eq 'parse') {
handle_errors($registrar, $error_count, \@opened_files);
- next;
+ goto NEXT;
+ }
+
+ my $document_information = $document->global_information();
+ if (get_conf('SHOW_INCLUDE_FILE_PATHS')) {
+ handle_errors($registrar, $error_count, \@opened_files);
+ my $included_file_paths = $document_information->{'included_files'};
+ if (defined($included_file_paths)) {
+ foreach my $included_file (@$included_file_paths) {
+ print STDOUT "$included_file\n";
+ }
+ }
+ goto NEXT;
}
if ($tree_transformations{'fill_gaps_in_sectioning'}) {
@@ -1516,7 +1528,6 @@ while(@input_files) {
# needing access to the configuration information.
my $main_configuration = Texinfo::MainConfig::new();
- my $document_information = $document->global_information();
# encoding is needed for output files
# encoding and documentlanguage are needed for gdt() in
regenerate_master_menu
Texinfo::Common::set_output_encodings($main_configuration, $document);
@@ -1581,7 +1592,7 @@ while(@input_files) {
}
if (get_conf('DUMP_TEXI') or $formats_table{$format}->{'texi2dvi_format'}) {
handle_errors($registrar, $error_count, \@opened_files);
- next;
+ goto NEXT;
}
if
($formats_table{$converted_format}->{'relate_index_entries_to_table_items'}
@@ -1673,7 +1684,7 @@ while(@input_files) {
$error_count = handle_errors($registrar, $error_count, \@opened_files);
if ($format eq 'structure') {
- next;
+ goto NEXT;
}
# a shallow copy is not sufficient for arrays and hashes to make
# sure that the $cmdline_options are not modified if $file_cmdline_options
@@ -1867,8 +1878,9 @@ while(@input_files) {
}
}
- Texinfo::Document::remove_document($document);
$converter->destroy();
+ NEXT:
+ Texinfo::Document::remove_document($document);
}
foreach my $unclosed_file (keys(%main_unclosed_files)) {