[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Common.pm (encode_file_name), tp/Tex
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Common.pm (encode_file_name), tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/Utils.pm, tp/Texinfo/ParserNonXS.pm, tp/texi2any.pl: remove encode_file_name() $customization_information argument, customization should be taken into account in caller. |
Date: |
Tue, 13 Sep 2022 17:00:54 -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 a7e8bd6255 * tp/Texinfo/Common.pm (encode_file_name),
tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/Utils.pm,
tp/Texinfo/ParserNonXS.pm, tp/texi2any.pl: remove encode_file_name()
$customization_information argument, customization should be taken into account
in caller.
a7e8bd6255 is described below
commit a7e8bd625564f7c1b6bb22696c8b829952d7d0f5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Sep 13 23:00:40 2022 +0200
* tp/Texinfo/Common.pm (encode_file_name),
tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/Utils.pm,
tp/Texinfo/ParserNonXS.pm, tp/texi2any.pl: remove encode_file_name()
$customization_information argument, customization should be taken
into account in caller.
* tp/Texinfo/Common.pm (valid_customization_option),
tp/Texinfo/Config.pm, tp/Texinfo/Convert/Converter.pm,
tp/Texinfo/Convert/HTML.pm: rename valid_option() as
valid_customization_option().
* tp/Texinfo/Convert/NodeNameNormalization.pm (convert_to_normalized),
tp/Texinfo/Convert/HTML.pm, tp/init/highlight_syntax.pm: rename
convert() as convert_to_normalized().
* tp/Texinfo/Common.pm, tp/texi2any.pl: inline warn_unknown_split() in
main program.
* tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm: remove N__ it is
not used anywhere.
* tp/Texinfo/Common.pm: remove unused %customization_variable_classes.
---
ChangeLog | 25 ++++++
tp/Texinfo/Common.pm | 120 ++++++++++++----------------
tp/Texinfo/Config.pm | 4 +-
tp/Texinfo/Convert/Converter.pm | 12 +--
tp/Texinfo/Convert/HTML.pm | 6 +-
tp/Texinfo/Convert/NodeNameNormalization.pm | 44 +++++-----
tp/Texinfo/Convert/Utils.pm | 9 +--
tp/Texinfo/ParserNonXS.pm | 7 +-
tp/init/highlight_syntax.pm | 6 +-
tp/texi2any.pl | 19 +++--
10 files changed, 136 insertions(+), 116 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3a0b86d5ac..2911cd1ec3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2022-09-13 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Common.pm (encode_file_name),
+ tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/Utils.pm,
+ tp/Texinfo/ParserNonXS.pm, tp/texi2any.pl: remove encode_file_name()
+ $customization_information argument, customization should be taken
+ into account in caller.
+
+ * tp/Texinfo/Common.pm (valid_customization_option),
+ tp/Texinfo/Config.pm, tp/Texinfo/Convert/Converter.pm,
+ tp/Texinfo/Convert/HTML.pm: rename valid_option() as
+ valid_customization_option().
+
+ * tp/Texinfo/Convert/NodeNameNormalization.pm (convert_to_normalized),
+ tp/Texinfo/Convert/HTML.pm, tp/init/highlight_syntax.pm: rename
+ convert() as convert_to_normalized().
+
+ * tp/Texinfo/Common.pm, tp/texi2any.pl: inline warn_unknown_split() in
+ main program.
+
+ * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm: remove N__ it is
+ not used anywhere.
+
+ * tp/Texinfo/Common.pm: remove unused %customization_variable_classes.
+
2022-09-13 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): do not modify
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index cc516c5763..26bf6c59a0 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -31,6 +31,8 @@ use File::Spec;
# for find_encoding, resolve_alias and maybe utf8 related functions
use Encode;
+use Locale::Messages;
+
use Texinfo::Documentlanguages;
# debugging
@@ -64,12 +66,22 @@ __ __p print_tree
$VERSION = '6.8dev';
+
# i18n
-sub N__($)
-{
- return $_[0];
+my $messages_textdomain = 'texinfo';
+
+sub __($) {
+ my $msgid = shift;
+ return Locale::Messages::dgettext($messages_textdomain, $msgid);
+}
+
+sub __p($$) {
+ my $context = shift;
+ my $msgid = shift;
+ return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
}
+
# determine the null devices
my $default_null_device = File::Spec->devnull();
our %null_device_file = (
@@ -81,24 +93,12 @@ if ($Config{osname} eq 'dos' and $Config{osvers} eq
'djgpp') {
$null_device_file{'NUL'} = 1;
}
-use Locale::Messages;
-
-my $messages_textdomain = 'texinfo';
-
-sub __($) {
- my $msgid = shift;
- return Locale::Messages::dgettext($messages_textdomain, $msgid);
-}
-sub __p($$) {
- my $context = shift;
- my $msgid = shift;
- return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
-}
+# Customization options
-# not specific of Parser, used in other contexts. Spread over the different
-# categories set below. The default values are in general the same as
-# elsewheere, but occasionally may be specific of the Parser.
+# variables not specific of Parser, used in other contexts. Spread over
+# the different categories set below. The default values are in general
+# the same as elsewhere, but occasionally may be specific of the Parser.
my %default_parser_common_customization = (
'INCLUDE_DIRECTORIES' => [ '.' ],
'documentlanguage' => undef, # not 'en' as it is better to specify that
there is no
@@ -136,7 +136,8 @@ our %document_settable_multiple_at_commands = (
'contents' => 0,
'deftypefnnewline' => 'off',
'documentencoding' => 'us-ascii',
- 'documentlanguage' => 'en', # or undef? Documented as en. Also
--document-language
+ 'documentlanguage' => 'en', # or undef? Documented as en.
+ # --document-language
# is N ems in TeX, 0.4 in.
'exampleindent' => 5,
'firstparagraphindent' => 'none',
@@ -168,11 +169,10 @@ our %document_settable_unique_at_commands = (
'everyfootingmarks' => 'bottom',
'everyheadingmarks' => 'bottom',
'fonttextsize' => 11,
- 'footnotestyle' => 'end', # also --footnote-style
- 'novalidate' => 0,
+ 'footnotestyle' => 'end', # --footnote-style
+ 'novalidate' => 0, # --no-validate
'oddfootingmarks' => undef,
'oddheadingmarks' => undef,
- # FIXME not clear here.
'pagesizes' => undef,
'setchapternewpage' => 'on',
'setfilename' => undef,
@@ -269,7 +269,7 @@ our %default_converter_customization = (
# to avoid test results that are not valid against their reported DTD.
'TEXINFO_DTD_VERSION' => '6.8', # this is not the value documented,
# but it is better for the tests to
- # have a fix value.
+ # have a fixed value.
# The main program sets the
# variable to the documented value.
);
@@ -420,7 +420,7 @@ my @variable_other_settables = (
our %document_settable_at_commands = (%document_settable_multiple_at_commands,
%document_settable_unique_at_commands);
-my %valid_options;
+my %valid_customization_options;
foreach my $var (keys(%document_settable_at_commands),
keys(%default_main_program_command_line_options),
keys(%default_converter_command_line_options),
@@ -429,13 +429,13 @@ foreach my $var (keys(%document_settable_at_commands),
keys(%default_converter_customization),
@variable_string_settables,
@variable_other_settables) {
- $valid_options{$var} = 1;
+ $valid_customization_options{$var} = 1;
}
-sub valid_option($)
+sub valid_customization_option($)
{
my $option = shift;
- return $valid_options{$option};
+ return $valid_customization_options{$option};
}
# not documented on purpose, should not be called in user-defined
@@ -444,22 +444,14 @@ sub add_valid_customization_option($)
{
my $option = shift;
if ($option =~ /^[A-Z][A-Z_]{2,}$/) {
- $valid_options{$option} = 1;
+ $valid_customization_options{$option} = 1;
return 1;
}
return 0;
}
-my %customization_variable_classes = (
- 'document_settable_multiple_at_commands' => [
sort(keys(%document_settable_multiple_at_commands)) ],
- 'document_settable_unique_at_commands' => [
sort(keys(%document_settable_unique_at_commands)) ],
- 'command_line_settables' => [
sort((keys(%default_converter_command_line_options),
-
keys(%default_main_program_command_line_options))) ],
- 'variable_string_settables' => [ @variable_string_settables, sort(
- (keys(%default_parser_specific_customization),
keys(%default_main_program_customization),
- keys(%default_converter_customization))) ],
- 'variable_other_settables' => \@variable_other_settables,
-);
+
+# Tree transformations
my %valid_tree_transformations;
foreach my $valid_transformation ('simple_menus',
@@ -478,6 +470,9 @@ sub valid_tree_transformation ($)
return 0;
}
+
+# @-commands classifications
+
our %no_brace_commands; # commands never taking braces
%no_brace_commands = (
'*', "\n",
@@ -498,7 +493,6 @@ our %no_brace_commands; # commands never taking
braces
'\\', '\\', # should only appear in math
);
-
# commands taking a line as argument or no argument.
# sectioning commands and def* commands are added below.
# index commands are added dynamically.
@@ -771,7 +765,8 @@ $code_style_commands{'key'} = 1;
$code_style_commands{'verb'} = 1;
$code_style_commands{'indicateurl'} = 1;
-# Commands that enclose full texts, that can contain multiple paragraphs.
+# Commands that enclose full texts not in the main document context.
+# They can contain multiple paragraphs.
our %context_brace_commands;
foreach my $context_brace_command ('footnote', 'caption',
'shortcaption') {
@@ -780,8 +775,8 @@ foreach my $context_brace_command ('footnote', 'caption',
}
our %math_commands;
-# Commands that enclose full texts, that can contain multiple paragraphs
-# and contain maths
+# Commands that enclose math content, and, because of that, are not in the
+# main document context.
foreach my $math_brace_command ('math') {
$context_brace_commands{$math_brace_command} = $math_brace_command;
$brace_commands{$math_brace_command} = 'context';
@@ -838,7 +833,6 @@ foreach my $unformatted_brace_command ('anchor',
'shortcaption',
$unformatted_brace_commands{$unformatted_brace_command} = 1;
}
-
# commands delimiting blocks, with an @end.
# Value is either the number of arguments on the line separated by
# commas or the type of command, 'raw', 'def', 'conditional',
@@ -1402,22 +1396,6 @@ sub warn_unknown_language($) {
return @messages;
}
-my %possible_split = (
- 'chapter' => 1,
- 'section' => 1,
- 'node' => 1,
-);
-
-# main program
-sub warn_unknown_split($) {
- my $split = shift;
-
- my @messages = ();
- if ($split and !$possible_split{$split}) {
- push @messages, sprintf(__("%s is not a valid split possibility"), $split);
- }
- return @messages;
-}
sub _find_end_brace($$)
{
@@ -1571,20 +1549,20 @@ sub parse_node_manual($)
# ASCII, as the name of the directory it is located within may contain
# non-ASCII characters.
# Otherwise, the -e operator and similar may not work correctly.
-# TODO Really use customization_information? Document when the API is final
-sub encode_file_name($$;$)
+sub encode_file_name($$)
{
- my $customization_information = shift;
my $file_name = shift;
my $input_encoding = shift;
my $encoding;
- if ($input_encoding and ($input_encoding eq 'utf-8'
- or $input_encoding eq 'utf-8-strict')) {
+ return ($file_name, $encoding)
+ if (not defined($input_encoding));
+
+ if ($input_encoding eq 'utf-8' or $input_encoding eq 'utf-8-strict') {
utf8::encode($file_name);
$encoding = 'utf-8';
- } elsif (defined($input_encoding)) {
+ } else {
$file_name = Encode::encode($input_encoding, $file_name);
$encoding = $input_encoding;
}
@@ -3172,6 +3150,14 @@ Return true if the element passed in argument is in
running text
context. If the optional I<$check_current> argument is set,
check the element itself, in addition to the parent context.
+=item ($encoded_file_name, $encoding) = encode_file_name($file_name,
$input_encoding)
+
+Encode the I<$file_name> text string to a binary string I<$encoded_file_name>
+based on I<$input_encoding>. Also returns the I<$encoding> name actually
+used which may have undergone some normalization. This function is mostly
+a wrapper around L<Encode::encode> which avoids calling the module if not
+needed. Do nothing if I<$input_encoding> is C<undef>.
+
=item $text = enumerate_item_representation($specification, $number)
X<C<enumerate_item_representation>>
@@ -3329,7 +3315,7 @@ X<C<trim_spaces_comment_from_content>>
Remove empty spaces after commands or braces at begin and
spaces and comments at end from a content array, modifying it.
-=item valid_option($name)
+=item valid_customization_option($name)
X<C<valid_option>>
Return true if the I<$name> is a known customization option.
diff --git a/tp/Texinfo/Config.pm b/tp/Texinfo/Config.pm
index 3f02dc72e6..9e9c699e17 100644
--- a/tp/Texinfo/Config.pm
+++ b/tp/Texinfo/Config.pm
@@ -208,7 +208,7 @@ sub texinfo_set_from_init_file($$) {
if (!defined($var)) {
return 1;
}
- if (!Texinfo::Common::valid_option($var)) {
+ if (!Texinfo::Common::valid_customization_option($var)) {
# carp may be better, but infortunately, it points to the routine
# that loads the file, and not to the init file.
_GNUT_document_warn(sprintf(__("%s: unknown variable %s"),
@@ -235,7 +235,7 @@ sub GNUT_set_from_cmdline($$)
delete $init_files_options->{$var};
delete $main_program_default_options->{$var};
- if (!Texinfo::Common::valid_option($var)) {
+ if (!Texinfo::Common::valid_customization_option($var)) {
_GNUT_document_warn(sprintf(__("unknown variable from command line: %s\n"),
$var));
return 0;
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index a2b3554fe9..d3659f01ed 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -193,7 +193,7 @@ sub converter(;$)
if (!exists($defaults{$key}));
}
foreach my $key (keys(%defaults)) {
- if (Texinfo::Common::valid_option($key)) {
+ if (Texinfo::Common::valid_customization_option($key)) {
$converter->{'conf'}->{$key} = $defaults{$key};
} else {
$converter->{$key} = $defaults{$key};
@@ -217,7 +217,7 @@ sub converter(;$)
delete $conf->{'parser'};
}
foreach my $key (keys(%$conf)) {
- if (Texinfo::Common::valid_option($key)) {
+ if (Texinfo::Common::valid_customization_option($key)) {
$converter->{'conf'}->{$key} = $conf->{$key};
} elsif (!exists($defaults{$key})) {
warn "$key not a possible configuration in $name\n";
@@ -474,7 +474,7 @@ sub get_conf($$)
{
my $self = shift;
my $conf = shift;
- if (!Texinfo::Common::valid_option($conf)) {
+ if (!Texinfo::Common::valid_customization_option($conf)) {
confess("CBUG: unknown option $conf\n");
#return undef;
}
@@ -486,7 +486,7 @@ sub set_conf($$$)
my $self = shift;
my $conf = shift;
my $value = shift;
- if (!Texinfo::Common::valid_option($conf)) {
+ if (!Texinfo::Common::valid_customization_option($conf)) {
die "BBUG: unknown option $conf\n";
return undef;
}
@@ -503,7 +503,7 @@ sub force_conf($$$)
my $self = shift;
my $conf = shift;
my $value = shift;
- if (!Texinfo::Common::valid_option($conf)) {
+ if (!Texinfo::Common::valid_customization_option($conf)) {
die "ABUG: unknown option $conf\n";
return undef;
}
@@ -1071,7 +1071,7 @@ sub encoded_input_file_name($$)
$encoding = $self->get_conf('LOCALE_ENCODING');
}
- return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
+ return Texinfo::Common::encode_file_name($file_name, $encoding);
}
# A wrapper around Texinfo::Utils::encoded_output_file_name() that
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 9acb58b029..1d252a85bf 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -3952,7 +3952,8 @@ sub _convert_preformatted_command($$$$$)
# convert or remove all @-commands, using simple ascii and unicode
# characters
my $converted_arg
- = Texinfo::Convert::NodeNameNormalization::convert($example_arg);
+ = Texinfo::Convert::NodeNameNormalization::convert_to_normalized(
+ $example_arg);
if ($converted_arg ne '') {
push @classes, 'user-' . $converted_arg;
}
@@ -7843,7 +7844,8 @@ sub _prepare_conversion_tree_units($$$$)
# the presence of contents elements in the document is used in diverse
# places, set it once for all here
- my @contents_elements_options = grep {Texinfo::Common::valid_option($_)}
+ my @contents_elements_options
+ = grep {Texinfo::Common::valid_customization_option($_)}
keys(%contents_command_special_element_variety);
$self->set_global_document_commands('last', \@contents_elements_options);
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index ff885a1745..373da224c2 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -18,7 +18,7 @@
# Original author: Patrice Dumas <pertusus@free.fr>
# the rules for conversion are decribed in the Texinfo manual, for
-# HTML crossrefs.
+# HTML crossrefs in the 'HTML Xref' node.
package Texinfo::Convert::NodeNameNormalization;
@@ -46,6 +46,7 @@ use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
%EXPORT_TAGS = ( 'all' => [ qw(
normalize_node
transliterate_texinfo
+ transliterate_protect_file_name
) ] );
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@@ -85,7 +86,7 @@ foreach my $type ('empty_line_after_command',
'preamble_before_beginning',
sub normalize_node($)
{
my $root = shift;
- my $result = convert($root);
+ my $result = _convert($root);
$result = Unicode::Normalize::NFC($result);
$result = _unicode_to_protected($result);
$result = 'Top' if ($result =~ /^Top$/i);
@@ -96,7 +97,7 @@ sub transliterate_texinfo($;$)
{
my $root = shift;
my $no_unidecode = shift;
- my $result = convert($root);
+ my $result = _convert($root);
$result = Unicode::Normalize::NFC($result);
$result = _unicode_to_protected(
_unicode_to_transliterate($result, $no_unidecode));
@@ -113,7 +114,7 @@ sub transliterate_protect_file_name($;$)
return $result;
}
-sub convert($)
+sub convert_to_normalized($)
{
my $root = shift;
my $result = _convert($root);
@@ -229,7 +230,6 @@ sub _unicode_to_transliterate($;$)
}
-
sub _convert($;$);
sub _convert($;$)
@@ -421,47 +421,55 @@ Texinfo to other formats. There is no promise of API
stability.
=head1 DESCRIPTION
C<Texinfo::Convert::NodeNameNormalization> allows to normalize node names,
-with C<normalize_node> following the specification described in the
-Texinfo manual I<HTML Xref> node. This is usefull each time one want a
+with C<normalize_node> following the specification described in the
+Texinfo manual I<HTML Xref> node. This is usefull each time one want a
unique identifier for Texinfo content that is only composed of letter,
-digits, C<-> and C<_>. In L<Texinfo::Parser>, C<normalize_node> is used
-for C<@node>, C<@float> and C<@anchor> names normalization, but also C<@float>
+digits, C<-> and C<_>. In L<Texinfo::Parser>, C<normalize_node> is used
+for C<@node>, C<@float> and C<@anchor> names normalization, but also C<@float>
types and C<@acronym> and C<@abbr> first argument.
-It is also possible to transliterate non ascii letters, instead of mangling
-them, with C<transliterate_texinfo>, losing the uniqueness feature of
+It is also possible to transliterate non-ASCII letters, instead of mangling
+them, with C<transliterate_texinfo>, losing the uniqueness feature of
normalized node names.
-Another method, C<transliterate_protect_file_name> transliterates non ascii
+Another method, C<transliterate_protect_file_name> transliterates non-ASCII
letters and protect characters that should not appear on file names.
=head1 METHODS
=over
+=item $partially_normalized = convert_to_normalized($tree)
+X<C<convert_to_normalized>>
+
+The Texinfo I<$tree> is returned as a string, with @-commands and spaces
+normalized as described in the Texinfo manual I<HTML Xref> node. ASCII
+7-bit characters other than spaces and non-ASCII characters are left as
+is in the resulting string.
+
=item $normalized = normalize_node($tree)
X<C<normalize_node>>
The Texinfo I<$tree> is returned as a string, normalized as described in the
Texinfo manual I<HTML Xref> node.
-The result will be poor for Texinfo trees which are not @-command arguments
-(on an @-command line or in braces), for instance if the tree contains
+The result will be poor for Texinfo trees which are not @-command arguments
+(on an @-command line or in braces), for instance if the tree contains
C<@node> or block commands.
=item $transliterated = transliterate_texinfo($tree, $no_unidecode)
X<C<transliterate_texinfo>>
-The Texinfo I<$tree> is returned as a string, with non ascii letters
-transliterated as ascii, but otherwise similar with C<normalize_node>
+The Texinfo I<$tree> is returned as a string, with non-ASCII letters
+transliterated as ASCII, but otherwise similar with C<normalize_node>
output. If the optional I<$no_unidecode> argument is set, C<Text::Unidecode>
is not used for characters whose transliteration is not built-in.
=item $file_name = transliterate_protect_file_name($string, $no_unidecode)
X<C<transliterate_protect_file_name>>
-The string I<$string> is returned with non ascii letters transliterated as
-ascii, and ascii characters non safe in file names are protected as in
+The string I<$string> is returned with non-ASCII letters transliterated as
+ASCII, and ASCII characters not safe in file names protected as in
node normalization. If the optional I<$no_unidecode> argument is set,
C<Text::Unidecode> is not used for characters whose transliteration is not
built-in.
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index db3d8d7da5..9506547ecb 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -211,7 +211,8 @@ sub expand_verbatiminclude($$$)
if (defined($current->{'extra'}->{'input_perl_encoding'}));
my $encoding;
- my $input_file_name_encoding =
$customization_information->get_conf('INPUT_FILE_NAME_ENCODING');
+ my $input_file_name_encoding
+ = $customization_information->get_conf('INPUT_FILE_NAME_ENCODING');
if ($input_file_name_encoding) {
$encoding = $input_file_name_encoding;
} elsif
($customization_information->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
@@ -221,9 +222,7 @@ sub expand_verbatiminclude($$$)
}
my ($file_name, $file_name_encoding)
- = Texinfo::Common::encode_file_name($customization_information,
- $file_name_text,
- $encoding);
+ = Texinfo::Common::encode_file_name($file_name_text, $encoding);
my $file = Texinfo::Common::locate_include_file($customization_information,
$file_name);
@@ -334,7 +333,7 @@ sub encoded_output_file_name($$)
$encoding = $self->get_conf('LOCALE_ENCODING');
}
- return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
+ return Texinfo::Common::encode_file_name($file_name, $encoding);
}
# this requires a converter argument. It is defined here, in order
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index a6d35249d8..d3a58cdf2b 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -112,11 +112,6 @@ sub import {
$VERSION = '6.8dev';
-sub N__($)
-{
- return $_[0];
-}
-
# these are the default values for the parser state
# some could become configurable if moved to the next hash, but they
# are not configurable/implemented in the XS parser, so they are best
@@ -2033,7 +2028,7 @@ sub _encode_file_name($$)
$encoding = $self->get_conf('LOCALE_ENCODING');
}
- return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
+ return Texinfo::Common::encode_file_name($file_name, $encoding);
}
sub _save_line_directive
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index 95ff8196a4..313ac2ae1b 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -95,7 +95,8 @@ sub _get_language($$$)
if ($cmdname eq 'example') {
if ($command->{'args'} and scalar(@{$command->{'args'}}) > 0) {
$converted_language
- =
Texinfo::Convert::NodeNameNormalization::convert($command->{'args'}->[0]);
+ = Texinfo::Convert::NodeNameNormalization::convert_to_normalized(
+ $command->{'args'}->[0]);
if ($converted_language eq '') {
$converted_language = undef;
}
@@ -402,7 +403,8 @@ sub highlight_preformatted_command($$$$$)
# convert or remove all @-commands, using simple ascii and
unicode
# characters
my $converted_arg
- =
Texinfo::Convert::NodeNameNormalization::convert($example_arg);
+ =
Texinfo::Convert::NodeNameNormalization::convert_to_normalized(
+
$example_arg);
if ($converted_arg ne '') {
push @classes, $converted_arg;
}
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 83706a73f2..463e23919a 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -467,6 +467,12 @@ my @input_file_suffixes =
('.txi','.texinfo','.texi','.txinfo','');
my @texi2dvi_args = ();
+my %possible_split = (
+ 'chapter' => 1,
+ 'section' => 1,
+ 'node' => 1,
+);
+
# this associates the command line options to the arrays set during
# command line parsing.
my @css_files = ();
@@ -961,12 +967,10 @@ There is NO WARRANTY, to the extent permitted by
law.\n"), "2021");
}
},
'split=s' => sub { my $split = _decode_input($_[1]);
- my @messages
- = Texinfo::Common::warn_unknown_split($split);
- if (@messages) {
- foreach my $message (@messages) {
- document_warn($message);
- }
+ if (!$possible_split{$split}) {
+ document_warn(
+ sprintf(__("%s is not a valid split possibility"),
+ $split));
$split = 'node';
}
set_from_cmdline('SPLIT', $split); },
@@ -1668,8 +1672,7 @@ while(@input_files) {
my $sort_element_count_file_name = get_conf('SORT_ELEMENT_COUNT');
my ($encoded_sort_element_count_file_name, $path_encoding)
- = Texinfo::Common::encode_file_name($main_configuration,
- $sort_element_count_file_name,
+ = Texinfo::Common::encode_file_name($sort_element_count_file_name,
$input_perl_encoding);
my $sort_elem_files_information = {};
# FIXME using $converter here for the configuration is
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Common.pm (encode_file_name), tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/Utils.pm, tp/Texinfo/ParserNonXS.pm, tp/texi2any.pl: remove encode_file_name() $customization_information argument, customization should be taken into account in caller.,
Patrice Dumas <=