[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Mon, 23 Dec 2024 18:10:11 -0500 (EST) |
branch: master
commit b36889bdffc275eac266f9d9486acf55e52b6fa5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 8 22:45:31 2024 +0100
* tp/Texinfo/Convert/converters_defaults.txt,
tp/maintain/regenerate_C_options_info.pl: set defaults for parser array
variables. Select integer and strings only to set regular options in
C.
* tp/Texinfo/Common.pm: remove %array_parser_options, it is not useful
anymore.
---
ChangeLog | 10 ++++++++++
tp/Texinfo/Common.pm | 8 +-------
tp/Texinfo/Convert/converters_defaults.txt | 4 ++--
tp/Texinfo/Options.pm | 2 ++
tp/Texinfo/XS/main/options_init_free.c | 4 ++--
tp/maintain/regenerate_C_options_info.pl | 10 +++++++---
6 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5896ff4320..042ca9a5b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-12-08 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/converters_defaults.txt,
+ tp/maintain/regenerate_C_options_info.pl: set defaults for parser array
+ variables. Select integer and strings only to set regular options in
+ C.
+
+ * tp/Texinfo/Common.pm: remove %array_parser_options, it is not useful
+ anymore.
+
2024-12-08 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/converter.c (set_global_document_commands)
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 664390310b..6437c8492e 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -125,12 +125,6 @@ foreach my $variable_name ('MACRO_EXPAND',
'INTERNAL_LINKS') {
$non_decoded_customization_variables{$variable_name} = 1;
}
-# array variables not specific of Parser, used in other contexts.
-my %array_parser_options = (
- 'INCLUDE_DIRECTORIES' => [ '.' ],
- 'EXPANDED_FORMATS' => [],
-);
-
# can be modified through command-line, but not customization options
our %parser_document_state_configuration = (
# parsed document parsing information still relevant after parsing
@@ -154,7 +148,7 @@ my %parser_inner_options = (
# valid for the parser.
my $common_parser_regular_options_defaults
= Texinfo::Options::get_regular_options('common_parser');
-our %default_parser_customization_values = (%array_parser_options,
+our %default_parser_customization_values = (
%Texinfo::Options::parser_options,
%$common_parser_regular_options_defaults);
diff --git a/tp/Texinfo/Convert/converters_defaults.txt
b/tp/Texinfo/Convert/converters_defaults.txt
index c2806879dd..057b52343f 100644
--- a/tp/Texinfo/Convert/converters_defaults.txt
+++ b/tp/Texinfo/Convert/converters_defaults.txt
@@ -24,8 +24,6 @@
# the same as elsewhere, but occasionally may be specific of the Parser.
- common_parser
-# INCLUDE_DIRECTORIES [.]
-# EXPANDED_FORMATS []
# not 'en' as it is better to specify that there is no
# need for translation since the strings are in english
# rather than ask for translations to en
@@ -33,12 +31,14 @@ documentlanguage undef
# if >= 10, tree is printed in texi2any.pl after parsing.
# If >= 100 tree is printed every line.
DEBUG 0
+EXPANDED_FORMATS []
# if not 'menu' no menu error related.
FORMAT_MENU menu
# use document encoding for input file names encoding if set
DOC_ENCODING_FOR_INPUT_FILE_NAME 1
# encoding of command line strings used to decode file names for error messages
COMMAND_LINE_ENCODING undef
+INCLUDE_DIRECTORIES [ '.' ]
# used for input file name encoding
INPUT_FILE_NAME_ENCODING undef
# used for file name encoding
diff --git a/tp/Texinfo/Options.pm b/tp/Texinfo/Options.pm
index 7a000d98bb..68b02449c8 100644
--- a/tp/Texinfo/Options.pm
+++ b/tp/Texinfo/Options.pm
@@ -271,9 +271,11 @@ my %regular_options_types;
my %common_parser_regular_options_defaults = (
'documentlanguage' => undef,
'DEBUG' => 0,
+ 'EXPANDED_FORMATS' => [],
'FORMAT_MENU' => 'menu',
'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1,
'COMMAND_LINE_ENCODING' => undef,
+ 'INCLUDE_DIRECTORIES' => [ '.' ],
'INPUT_FILE_NAME_ENCODING' => undef,
'LOCALE_ENCODING' => undef,
);
diff --git a/tp/Texinfo/XS/main/options_init_free.c
b/tp/Texinfo/XS/main/options_init_free.c
index 03dcefd536..9af9404a88 100644
--- a/tp/Texinfo/XS/main/options_init_free.c
+++ b/tp/Texinfo/XS/main/options_init_free.c
@@ -20,8 +20,8 @@ initialize_options (OPTIONS *options)
initialize_option (&options->CSS_FILES, GOT_bytes_string_list, "CSS_FILES",
0);
initialize_option (&options->CSS_REFS, GOT_char_string_list, "CSS_REFS", 0);
- initialize_option (&options->EXPANDED_FORMATS, GOT_bytes_string_list,
"EXPANDED_FORMATS", 0);
- initialize_option (&options->INCLUDE_DIRECTORIES, GOT_file_string_list,
"INCLUDE_DIRECTORIES", 0);
+ initialize_option (&options->EXPANDED_FORMATS, GOT_bytes_string_list,
"EXPANDED_FORMATS", OF_parser_option);
+ initialize_option (&options->INCLUDE_DIRECTORIES, GOT_file_string_list,
"INCLUDE_DIRECTORIES", OF_parser_option);
initialize_option (&options->TEXINFO_LANGUAGE_DIRECTORIES,
GOT_file_string_list, "TEXINFO_LANGUAGE_DIRECTORIES", 0);
/* converter_cmdline */
diff --git a/tp/maintain/regenerate_C_options_info.pl
b/tp/maintain/regenerate_C_options_info.pl
index 21bcdefc2a..c86863fa20 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -522,7 +522,9 @@ foreach my $format (@sorted_formats) {
my $option_info = $options{$option};
my ($category, $main_default, $type) = @$option_info;
my ($int_value, $char_value) = get_value($type, $value);
- print CDCF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
+ if ($type eq 'char' or $type eq 'bytes' or $type eq 'integer') {
+ print CDCF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
+ }
}
print CDCF "}\n\n";
@@ -532,8 +534,10 @@ foreach my $format (@sorted_formats) {
my $option_info = $options{$option};
my ($option_unused, $main_default, $type) = @$option_info;
my ($int_value, $char_value) = get_value($type, $value);
- print CDCF " add_option_value (options_list, "
- ."\"$option\", $int_value, $char_value);\n";
+ if ($type eq 'char' or $type eq 'bytes' or $type eq 'integer') {
+ print CDCF " add_option_value (options_list, "
+ ."\"$option\", $int_value, $char_value);\n";
+ }
}
print CDCF "}\n\n";
}