[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Wed, 2 Oct 2024 07:39:04 -0400 (EDT) |
branch: master
commit 8f751ebc8461b5c68f1cd52c9b4222658a93ece5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 1 10:24:26 2024 +0200
* tp/Texinfo/Convert/Converter.pm,
tp/Texinfo/Convert/converters_defaults.txt: add converter and common
'formats' options to use in Texinfo/Convert/Converter.pm.
---
ChangeLog | 6 ++++++
tp/Texinfo/Convert/Converter.pm | 23 ++++++++++++-----------
tp/Texinfo/Convert/converters_defaults.txt | 18 ++++++++++++++++++
tp/Texinfo/XS/convert/converters_defaults.c | 13 +++++++++++++
tp/Texinfo/XS/convert/converters_defaults.h | 4 ++++
tp/maintain/regenerate_perl_options_info.pl | 2 ++
6 files changed, 55 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d798c6e41c..2184825e3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-01 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Converter.pm,
+ tp/Texinfo/Convert/converters_defaults.txt: add converter and common
+ 'formats' options to use in Texinfo/Convert/Converter.pm.
+
2024-08-01 Patrice Dumas <pertusus@free.fr>
* tp/maintain/regenerate_C_options_info.pl: fix parsing of converter
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index be4195f3d5..052e5da367 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -124,9 +124,16 @@ sub import {
goto &Exporter::import;
}
-my %defaults = (
- 'documentlanguage' => undef,
-);
+# values for integer and string options in code generated from
+# Texinfo/Convert/converters_defaults.txt
+my $regular_defaults
+ = Texinfo::Options::get_converter_regular_options('converter');
+
+my %defaults = %$regular_defaults;
+
+# values for integer and string options in code generated from
+# Texinfo/Convert/converters_defaults.txt
+my $common_defaults =
Texinfo::Options::get_converter_regular_options('common');
# defaults for all converters that are not defined elsewhere.
# undef values in general marks information passed by the caller that
@@ -150,14 +157,8 @@ my %common_converters_defaults = (
# Not set in the main program
'translated_commands' => {'error' => 'error@arrow{}',},
-# This is the default, mainly for tests; the caller should set them. These
-# values are what is used in tests of the Converters. These variables are
-# customization options, set in the main program when a converter is
-# called from the main program.
- 'PACKAGE_AND_VERSION' => 'texinfo',
- 'PACKAGE_VERSION' => '',
- 'PACKAGE_URL' => 'http://www.gnu.org/software/texinfo/',
- 'PROGRAM' => '',
+# integer and string customization variables common for all the converters
+ %$common_defaults
);
my %all_converters_defaults
diff --git a/tp/Texinfo/Convert/converters_defaults.txt
b/tp/Texinfo/Convert/converters_defaults.txt
index 422a7606d0..5c45993fa2 100644
--- a/tp/Texinfo/Convert/converters_defaults.txt
+++ b/tp/Texinfo/Convert/converters_defaults.txt
@@ -18,6 +18,24 @@
# this information is used to setup converter options for both C and
# Perl.
+# for Texinfo::Convert::Converter
+- converter
+
+documentlanguage undef
+
+# in Texinfo::Convert::Converter, common to all the converters
+- common
+
+# This is the default, mainly for tests; the caller should set them. These
+# values are what is used in tests of the Converters. These variables are
+# customization options, set in the main program when a converter is
+# called from the main program.
+PACKAGE_AND_VERSION texinfo
+PACKAGE_VERSION
+PACKAGE_URL http://www.gnu.org/software/texinfo/
+PROGRAM
+
+
- html
BIG_RULE <hr>
diff --git a/tp/Texinfo/XS/convert/converters_defaults.c
b/tp/Texinfo/XS/convert/converters_defaults.c
index bc98cca600..5b47a708ab 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.c
+++ b/tp/Texinfo/XS/convert/converters_defaults.c
@@ -6,6 +6,19 @@
#include "converter.h"
#include "converters_defaults.h"
+void set_common_regular_options_defaults (OPTIONS *options)
+{
+ set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
+ set_conf (&options->PACKAGE_VERSION, -2, "");
+ set_conf (&options->PACKAGE_URL, -2, "http://www.gnu.org/software/texinfo/");
+ set_conf (&options->PROGRAM, -2, "");
+}
+
+void set_converter_regular_options_defaults (OPTIONS *options)
+{
+ set_conf (&options->documentlanguage, -2, 0);
+}
+
void set_html_regular_options_defaults (OPTIONS *options)
{
set_conf (&options->BIG_RULE, -2, "<hr>");
diff --git a/tp/Texinfo/XS/convert/converters_defaults.h
b/tp/Texinfo/XS/convert/converters_defaults.h
index 6cdb21befa..a895b0488f 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.h
+++ b/tp/Texinfo/XS/convert/converters_defaults.h
@@ -12,6 +12,10 @@
#undef PACKAGE_URL
#undef PACKAGE_VERSION
+void set_common_regular_options_defaults (OPTIONS *options);
+
+void set_converter_regular_options_defaults (OPTIONS *options);
+
void set_html_regular_options_defaults (OPTIONS *options);
#endif
diff --git a/tp/maintain/regenerate_perl_options_info.pl
b/tp/maintain/regenerate_perl_options_info.pl
index a7f6f4d65d..c636b81476 100755
--- a/tp/maintain/regenerate_perl_options_info.pl
+++ b/tp/maintain/regenerate_perl_options_info.pl
@@ -116,6 +116,8 @@ foreach my $category (sort(keys(%option_categories))) {
print OUT ");\n\n";
}
+print OUT "\n\n#################################################\n\n";
+
my @sorted_formats = sort(keys(%converter_defaults));
my $function_lines = '';