[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Converter.pm (converter), tp
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Converter.pm (converter), tp/Texinfo/Convert/Text.pm (converter), tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm: rename converters field 'extra' as 'global_commands' to be more specific and avoid a field that is already used by tree elements. |
Date: |
Tue, 07 Sep 2021 18:39:49 -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 a723dc8 * tp/Texinfo/Convert/Converter.pm (converter),
tp/Texinfo/Convert/Text.pm (converter), tp/Texinfo/Convert/DocBook.pm,
tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm,
tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm,
tp/Texinfo/Convert/Plaintext.pm: rename converters field 'extra' as
'global_commands' to be more specific and avoid a field that is already used by
tree elements.
a723dc8 is described below
commit a723dc8e6abfa939aeb5152a7894486d7c1a5bf7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Sep 8 00:39:40 2021 +0200
* tp/Texinfo/Convert/Converter.pm (converter),
tp/Texinfo/Convert/Text.pm (converter),
tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm,
tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm,
tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm:
rename converters field 'extra' as 'global_commands' to be more
specific and avoid a field that is already used by tree elements.
---
ChangeLog | 10 +++++++
tp/Texinfo/Convert/Converter.pm | 23 ++++++++-------
tp/Texinfo/Convert/DocBook.pm | 5 ++--
tp/Texinfo/Convert/HTML.pm | 62 +++++++++++++++++++++--------------------
tp/Texinfo/Convert/IXIN.pm | 20 ++++++-------
tp/Texinfo/Convert/Info.pm | 4 +--
tp/Texinfo/Convert/LaTeX.pm | 25 +++++++++--------
tp/Texinfo/Convert/Plaintext.pm | 22 ++++++++-------
tp/Texinfo/Convert/Text.pm | 16 ++++++-----
9 files changed, 104 insertions(+), 83 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 43ccc70..5a80612 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2021-09-08 Patrice Dumas <pertusus@free.fr>
+ * tp/Texinfo/Convert/Converter.pm (converter),
+ tp/Texinfo/Convert/Text.pm (converter),
+ tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm,
+ tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm,
+ tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm:
+ rename converters field 'extra' as 'global_commands' to be more
+ specific and avoid a field that is already used by tree elements.
+
+2021-09-08 Patrice Dumas <pertusus@free.fr>
+
* tp/Texinfo/Convert/Converter.pm
(normalized_sectioning_command_filename), tp/Texinfo/Convert/HTML.pm:
rename _sectioning_command_normalized_filename() as
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 1f5d04d..1ae7189 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -180,7 +180,7 @@ sub converter(;$)
if (defined($conf)) {
if ($conf->{'parser'}) {
$converter->{'parser'} = $conf->{'parser'};
- $converter->{'extra'}
+ $converter->{'global_commands'}
= $converter->{'parser'}->global_commands_information();
$converter->{'parser_info'} =
$converter->{'parser'}->global_informations();
my $floats = $converter->{'parser'}->floats_information();
@@ -297,17 +297,18 @@ sub set_global_document_commands($$;$)
} else {
foreach my $global_command (@{$selected_commands}) {
my $root;
- if (defined($self->{'extra'}->{$global_command})
- and ref($self->{'extra'}->{$global_command}) eq 'ARRAY') {
+ if (defined($self->{'global_commands'}->{$global_command})
+ and ref($self->{'global_commands'}->{$global_command}) eq 'ARRAY') {
# used when $commands_location == 1
my $index_in_global_commands = 0;
if ($commands_location < 0) {
$index_in_global_commands = -1;
}
- $root =
$self->{'extra'}->{$global_command}->[$index_in_global_commands];
- } elsif (defined($self->{'extra'}->{$global_command})) {
+ $root =
+
$self->{'global_commands'}->{$global_command}->[$index_in_global_commands];
+ } elsif (defined($self->{'global_commands'}->{$global_command})) {
# unique command, first and last are the same
- $root = $self->{'extra'}->{$global_command};
+ $root = $self->{'global_commands'}->{$global_command};
}
if ($self->get_conf('DEBUG')) {
print STDERR "SET_global_multiple_commands($commands_location)
$global_command\n";
@@ -394,10 +395,12 @@ sub determine_files_and_directory($)
my $setfilename;
if (defined($self->get_conf('setfilename'))) {
$setfilename = $self->get_conf('setfilename');
- } elsif ($self->{'extra'} and $self->{'extra'}->{'setfilename'}
- and $self->{'extra'}->{'setfilename'}->{'extra'}
- and
defined($self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'})) {
- $setfilename = $self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'}
+ } elsif ($self->{'global_commands'}
+ and $self->{'global_commands'}->{'setfilename'}
+ and $self->{'global_commands'}->{'setfilename'}->{'extra'}
+ and
defined($self->{'global_commands'}->{'setfilename'}->{'extra'}->{'text_arg'})) {
+ $setfilename
+ = $self->{'global_commands'}->{'setfilename'}->{'extra'}->{'text_arg'};
}
my $input_basename_for_outfile = $input_basename;
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index f528126..568c680 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -749,9 +749,10 @@ sub _convert($$;$)
}
} elsif ($type eq 'skipline' or $type eq 'noarg') {
if ($root->{'cmdname'} eq 'insertcopying') {
- if ($self->{'extra'} and $self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'}
+ and $self->{'global_commands'}->{'copying'}) {
return $self->_convert({'contents'
- => $self->{'extra'}->{'copying'}->{'contents'}});
+ => $self->{'global_commands'}->{'copying'}->{'contents'}});
} else {
return '';
}
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 4295635..69b61ad 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -2965,9 +2965,9 @@ sub _convert_insertcopying_command($$$$)
my $cmdname = shift;
my $command = shift;
- if ($self->{'extra'} and $self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'} and $self->{'global_commands'}->{'copying'}) {
return $self->convert_tree({'contents'
- => $self->{'extra'}->{'copying'}->{'contents'}});
+ => $self->{'global_commands'}->{'copying'}->{'contents'}});
}
return '';
}
@@ -4720,9 +4720,9 @@ sub _default_format_titlepage($)
my $self = shift;
my $titlepage_text;
- if ($self->{'extra'}->{'titlepage'}) {
+ if ($self->{'global_commands'}->{'titlepage'}) {
$titlepage_text = $self->convert_tree({'contents'
- => $self->{'extra'}->{'titlepage'}->{'contents'}});
+ => $self->{'global_commands'}->{'titlepage'}->{'contents'}});
} elsif ($self->{'simpletitle_tree'}) {
my $title_text = $self->convert_tree_new_formatting_context(
$self->{'simpletitle_tree'}, 'simpletitle_string');
@@ -5667,8 +5667,9 @@ sub _get_element($$;$)
return ($element, $root_command) if defined($element);
} elsif ($region_commands{$current->{'cmdname'}}) {
if ($current->{'cmdname'} eq 'copying'
- and $self->{'extra'} and $self->{'extra'}->{'insertcopying'}) {
- foreach my $insertcopying(@{$self->{'extra'}->{'insertcopying'}}) {
+ and $self->{'global_commands'}
+ and $self->{'global_commands'}->{'insertcopying'}) {
+ foreach my
$insertcopying(@{$self->{'global_commands'}->{'insertcopying'}}) {
my ($element, $root_command)
= $self->_get_element($insertcopying, $find_container);
return ($element, $root_command)
@@ -5920,7 +5921,7 @@ sub _prepare_special_elements($$$$)
}
}
}
- if ($self->{'extra'}->{'footnote'}
+ if ($self->{'global_commands'}->{'footnote'}
and $self->get_conf('footnotestyle') eq 'separate'
and $elements and scalar(@$elements) > 1) {
$do_special{'Footnotes'} = 1;
@@ -6030,13 +6031,14 @@ sub _prepare_contents_elements($)
}
} elsif ($self->get_conf('CONTENTS_OUTPUT_LOCATION') eq 'after_top') {
my $section_top = undef;
- if ($self->{'extra'} and $self->{'extra'}->{'top'}) {
- $section_top = $self->{'extra'}->{'top'};
+ if ($self->{'global_commands'} and
$self->{'global_commands'}->{'top'}) {
+ $section_top = $self->{'global_commands'}->{'top'};
$default_filename = $self->command_filename($section_top)
}
} elsif ($self->get_conf('CONTENTS_OUTPUT_LOCATION') eq 'inline') {
- if ($self->{'extra'} and $self->{'extra'}->{$cmdname}) {
- foreach my $command(@{$self->{'extra'}->{$cmdname}}) {
+ if ($self->{'global_commands'}
+ and $self->{'global_commands'}->{$cmdname}) {
+ foreach my $command(@{$self->{'global_commands'}->{$cmdname}}) {
my ($element, $root_command)
= $self->_get_element($command);
if (defined($element)) {
@@ -6087,9 +6089,9 @@ sub _prepare_global_targets($$)
$self->{'global_target_elements'}->{'Last'} = $elements->[-1];
# It is always the first printindex, even if it is not output (for example
# it is in @copying and @titlepage, which are certainly wrong constructs).
- if ($self->{'extra'} and $self->{'extra'}->{'printindex'}) {
+ if ($self->{'global_commands'} and
$self->{'global_commands'}->{'printindex'}) {
my ($element, $root_command)
- = $self->_get_element($self->{'extra'}->{'printindex'}->[0]);
+ = $self->_get_element($self->{'global_commands'}->{'printindex'}->[0]);
if (defined($element)) {
if ($root_command and $root_command->{'cmdname'} eq 'node'
and $element->{'extra'}->{'section'}) {
@@ -6110,7 +6112,7 @@ sub _prepare_global_targets($$)
my $node_top;
$node_top = $self->{'labels'}->{'Top'} if ($self->{'labels'});
my $section_top;
- $section_top = $self->{'extra'}->{'top'} if ($self->{'extra'});
+ $section_top = $self->{'global_commands'}->{'top'} if
($self->{'global_commands'});
if ($section_top) {
$self->{'global_target_elements'}->{'Top'} = $section_top->{'parent'};
} elsif ($node_top) {
@@ -6186,9 +6188,9 @@ sub _prepare_footnotes($)
{
my $self = shift;
- if ($self->{'extra'}->{'footnote'}) {
+ if ($self->{'global_commands'}->{'footnote'}) {
my $footnote_nr = 0;
- foreach my $footnote (@{$self->{'extra'}->{'footnote'}}) {
+ foreach my $footnote (@{$self->{'global_commands'}->{'footnote'}}) {
$footnote_nr++;
my $nr = $footnote_nr;
my $footid = $footid_base.$nr;
@@ -7220,7 +7222,7 @@ sub _has_contents_or_shortcontents($)
{
my $self = shift;
foreach my $cmdname ('contents', 'shortcontents') {
- if ($self->{'extra'} and $self->{'extra'}->{$cmdname}) {
+ if ($self->{'global_commands'} and $self->{'global_commands'}->{$cmdname})
{
return 1;
}
}
@@ -7462,8 +7464,8 @@ sub output($$)
my $fulltitle;
foreach my $fulltitle_command('settitle', 'title',
'shorttitlepage', 'top') {
- if ($self->{'extra'}->{$fulltitle_command}) {
- my $command = $self->{'extra'}->{$fulltitle_command};
+ if ($self->{'global_commands'}->{$fulltitle_command}) {
+ my $command = $self->{'global_commands'}->{$fulltitle_command};
next if (!$command->{'args'}
or (!$command->{'args'}->[0]->{'contents'}
or $command->{'extra'}->{'missing_argument'}));
@@ -7473,16 +7475,16 @@ sub output($$)
last;
}
}
- if (!$fulltitle and $self->{'extra'}->{'titlefont'}
- and $self->{'extra'}->{'titlefont'}->[0]->{'args'}
- and defined($self->{'extra'}->{'titlefont'}->[0]->{'args'}->[0])
- and
@{$self->{'extra'}->{'titlefont'}->[0]->{'args'}->[0]->{'contents'}}) {
- $fulltitle = $self->{'extra'}->{'titlefont'}->[0];
+ if (!$fulltitle and $self->{'global_commands'}->{'titlefont'}
+ and $self->{'global_commands'}->{'titlefont'}->[0]->{'args'}
+ and
defined($self->{'global_commands'}->{'titlefont'}->[0]->{'args'}->[0])
+ and
@{$self->{'global_commands'}->{'titlefont'}->[0]->{'args'}->[0]->{'contents'}})
{
+ $fulltitle = $self->{'global_commands'}->{'titlefont'}->[0];
}
# prepare simpletitle
foreach my $simpletitle_command('settitle', 'shorttitlepage') {
- if ($self->{'extra'}->{$simpletitle_command}) {
- my $command = $self->{'extra'}->{$simpletitle_command};
+ if ($self->{'global_commands'}->{$simpletitle_command}) {
+ my $command = $self->{'global_commands'}->{$simpletitle_command};
next if ($command->{'extra'}
and $command->{'extra'}->{'missing_argument'});
$self->{'simpletitle_tree'} =
@@ -7512,9 +7514,9 @@ sub output($$)
}
# copying comment
- if ($self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'}->{'copying'}) {
my $copying_comment = Texinfo::Convert::Text::convert_to_text(
- {'contents' => $self->{'extra'}->{'copying'}->{'contents'}},
+ {'contents' => $self->{'global_commands'}->{'copying'}->{'contents'}},
{Texinfo::Convert::Text::copy_options_for_convert_text($self)});
if ($copying_comment ne '') {
$self->{'copying_comment'} = &{$self->{'format_comment'}}($self,
$copying_comment);
@@ -7526,11 +7528,11 @@ sub output($$)
if (defined($self->get_conf('documentdescription'))) {
$self->{'documentdescription_string'}
= $self->get_conf('documentdescription');
- } elsif ($self->{'extra'}->{'documentdescription'}) {
+ } elsif ($self->{'global_commands'}->{'documentdescription'}) {
$self->{'documentdescription_string'}
= $self->convert_tree_new_formatting_context(
{'type' => '_string',
- 'contents' => $self->{'extra'}->{'documentdescription'}->{'contents'}},
+ 'contents' =>
$self->{'global_commands'}->{'documentdescription'}->{'contents'}},
'documentdescription');
chomp($self->{'documentdescription_string'});
}
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index 3894ca4..a79af48 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -342,17 +342,17 @@ sub output_ixin($$)
my %setting_commands_defaults;
# FIXME this code is unclear and probably needs to be fixed if developemnt
# resumes.
- foreach my $global_command (keys(%{$self->{'extra'}})) {
+ foreach my $global_command (keys(%{$self->{'global_commands'}})) {
if ((($Texinfo::Common::misc_commands{$global_command}
and $Texinfo::Common::misc_commands{$global_command} =~ /^\d/)
or $additional_setting_commands{$global_command})
and !$global_misc_not_setting_commands{$global_command}) {
- if (ref($self->{'extra'}->{$global_command}) eq 'ARRAY') {
+ if (ref($self->{'global_commands'}->{$global_command}) eq 'ARRAY') {
if
(defined($Texinfo::Common::document_settable_multiple_at_commands{$global_command}))
{
$setting_commands_defaults{$global_command}
=
$Texinfo::Common::document_settable_multiple_at_commands{$global_command};
}
- foreach my $command (@{$self->{'extra'}->{$global_command}}) {
+ foreach my $command (@{$self->{'global_commands'}->{$global_command}})
{
my ($element, $root_command) = _get_element($self, $command);
# before first node
if (!defined($root_command->{'extra'})
@@ -371,7 +371,7 @@ sub output_ixin($$)
$setting_commands_defaults{$global_command}
=
$Texinfo::Common::document_settable_unique_at_commands{$global_command};
}
- $setting_commands{$global_command} =
$self->{'extra'}->{$global_command};
+ $setting_commands{$global_command} =
$self->{'global_commands'}->{$global_command};
}
}
}
@@ -409,8 +409,8 @@ sub output_ixin($$)
$result .= $self->ixin_close_element('settings');
foreach my $region ('copying', 'titlepage') {
- if ($self->{'extra'}->{$region}) {
- $result .= $self->convert_tree($self->{'extra'}->{$region});
+ if ($self->{'global_commands'}->{$region}) {
+ $result .= $self->convert_tree($self->{'global_commands'}->{$region});
} else {
$result .= $self->ixin_none_element($region);
}
@@ -654,8 +654,8 @@ sub output_ixin($$)
}
# Gather informations on printindex @-commands associated node id
- if ($self->{'extra'}->{'printindex'}) {
- foreach my $command (@{$self->{'extra'}->{'printindex'}}) {
+ if ($self->{'global_commands'}->{'printindex'}) {
+ foreach my $command (@{$self->{'global_commands'}->{'printindex'}}) {
my $associated_node_id = $self->_associated_node_id($command,
\%node_label_number);
if ($command->{'extra'} and $command->{'extra'}->{'misc_args'}
@@ -709,8 +709,8 @@ sub output_ixin($$)
}
# collect listoffloats information
- if ($self->{'extra'}->{'listoffloats'}) {
- foreach my $command (@{$self->{'extra'}->{'listoffloats'}}) {
+ if ($self->{'global_commands'}->{'listoffloats'}) {
+ foreach my $command (@{$self->{'global_commands'}->{'listoffloats'}}) {
my $associated_node_id = $self->_associated_node_id($command,
\%node_label_number);
my $type = $command->{'extra'}->{'type'}->{'normalized'};
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index 8b8237a..474e760 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -343,11 +343,11 @@ sub _info_header($$$)
# in the document. However this is the best guess we can do.
my @informative_global_commands = $self->get_informative_global_commands();
$self->set_global_document_commands(1, \@informative_global_commands);
- if ($self->{'extra'} and $self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'} and $self->{'global_commands'}->{'copying'}) {
print STDERR "COPYING HEADER\n" if ($self->get_conf('DEBUG'));
$self->{'in_copying_header'} = 1;
my $copying = $self->convert_tree({'contents' =>
- $self->{'extra'}->{'copying'}->{'contents'}});
+ $self->{'global_commands'}->{'copying'}->{'contents'}});
$result .= $copying;
$result .= $self->process_footnotes();
delete $self->{'in_copying_header'};
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 835dfb3..aeb849c 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -711,7 +711,7 @@ sub converter_initialize($)
if ($self->get_conf('ENABLE_ENCODING')) {
# Do not use utf-8 encoded curly quotes if '@documentencoding UTF-8'
# is not given.
- if ($self->{'extra'}->{'documentencoding'}) {
+ if ($self->{'global_commands'}->{'documentencoding'}) {
foreach my $quoted_command (@quoted_commands) {
# Directed single quotes
$self->{'quotes_map'}->{$quoted_command} = ["\x{2018}", "\x{2019}"];
@@ -805,8 +805,8 @@ sub _prepare_conversion($;$)
$self->associate_other_nodes_to_sections($root);
}
- if ($self->{'extra'}->{'settitle'}) {
- my $settitle_root = $self->{'extra'}->{'settitle'};
+ if ($self->{'global_commands'}->{'settitle'}) {
+ my $settitle_root = $self->{'global_commands'}->{'settitle'};
if (not ($settitle_root->{'extra'}
and $settitle_root->{'extra'}->{'missing_argument'})) {
$self->{'settitle_tree'} =
@@ -1080,7 +1080,7 @@ sub _latex_header {
$header .= "\\usepackage[$encoding]{inputenc}\n";
}
$header .= "\n";
- #if ($self->{'extra'}->{'shortcontents'}) {
+ #if ($self->{'global_commands'}->{'shortcontents'}) {
# # in texlive-latex-extra in debian
# $header .= "\\usepackage{shorttoc}\n";
#}
@@ -1185,8 +1185,8 @@ roundcorner=10pt}
# setup headings before titlepage to have no headings
# before titlepage. They will be set to 'on' after
# the titlepage if there is a titlepage
- if (exists($self->{'extra'}->{'titlepage'})
- or exists($self->{'extra'}->{'shorttitlepage'})) {
+ if (exists($self->{'global_commands'}->{'titlepage'})
+ or exists($self->{'global_commands'}->{'shorttitlepage'})) {
$header .= "% no headings before titlepage\n";
$header .= _set_headings($self, 'off');
$header .= "\n";
@@ -1201,8 +1201,8 @@ sub _begin_document($)
my $result = '';
$result .= '\begin{document}
';
- if (exists($self->{'extra'}->{'titlepage'})
- or exists($self->{'extra'}->{'shorttitlepage'})) {
+ if (exists($self->{'global_commands'}->{'titlepage'})
+ or exists($self->{'global_commands'}->{'shorttitlepage'})) {
$result .= "\n\\GNUTexinfofrontmatter\n";
}
return $result;
@@ -1386,8 +1386,8 @@ sub _set_chapter_new_page($$)
# reset headings after titlepage only, or immediately
# if there is no titlepage
- if ((not $self->{'extra'}->{'titlepage'}
- and not $self->{'extra'}->{'shorttitlepage'})
+ if ((not $self->{'global_commands'}->{'titlepage'}
+ and not $self->{'global_commands'}->{'shorttitlepage'})
or $self->{'titlepage_done'}) {
$result .= _set_headings($self, 'on');
}
@@ -2600,9 +2600,10 @@ sub _convert($$)
if ($expansion);
return $result;
} elsif ($command eq 'insertcopying') {
- if ($self->{'extra'} and $self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'}
+ and $self->{'global_commands'}->{'copying'}) {
unshift @{$self->{'current_contents'}->[-1]},
- {'contents' => $self->{'extra'}->{'copying'}->{'contents'}};
+ {'contents' =>
$self->{'global_commands'}->{'copying'}->{'contents'}};
}
return $result;
} elsif ($command eq 'printindex') {
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 3831172..fc89d5c 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -404,7 +404,7 @@ sub converter_initialize($)
and $self->get_conf('OUTPUT_ENCODING_NAME') eq 'utf-8') {
# cache this to avoid redoing calls to get_conf
$self->{'to_utf8'} = 1;
- if (!$self->{'extra'}->{'documentencoding'}) {
+ if (!$self->{'global_commands'}->{'documentencoding'}) {
# Do not use curly quotes or some other unnecessary non-ASCII characters
# if '@documentencoding UTF-8' is not given.
$self->{'convert_text_options'}->{'no_extra_unicode'} = 1;
@@ -575,7 +575,7 @@ sub _process_text($$$)
}
if ($self->{'to_utf8'}
- and $self->{'extra'}->{'documentencoding'}) {
+ and $self->{'global_commands'}->{'documentencoding'}) {
return Texinfo::Convert::Unicode::unicode_text($text,
$context->{'font_type_stack'}->[-1]->{'monospace'});
} elsif (!$context->{'font_type_stack'}->[-1]->{'monospace'}) {
@@ -2433,12 +2433,13 @@ sub _convert($$)
and $command ne 'part') {
$contents = $root->{'args'}->[0]->{'contents'};
} elsif ($command eq 'top'
- and $self->{'extra'}->{'settitle'}
- and $self->{'extra'}->{'settitle'}->{'args'}
- and @{$self->{'extra'}->{'settitle'}->{'args'}}
- and $self->{'extra'}->{'settitle'}->{'args'}->[0]->{'contents'}
- and @{$self->{'extra'}->{'settitle'}->{'args'}->[0]->{'contents'}}) {
- $contents =
$self->{'extra'}->{'settitle'}->{'args'}->[0]->{'contents'};
+ and $self->{'global_commands'}->{'settitle'}
+ and $self->{'global_commands'}->{'settitle'}->{'args'}
+ and @{$self->{'global_commands'}->{'settitle'}->{'args'}}
+ and
$self->{'global_commands'}->{'settitle'}->{'args'}->[0]->{'contents'}
+ and
@{$self->{'global_commands'}->{'settitle'}->{'args'}->[0]->{'contents'}}) {
+ $contents =
+
$self->{'global_commands'}->{'settitle'}->{'args'}->[0]->{'contents'};
}
if ($contents) {
@@ -2570,9 +2571,10 @@ sub _convert($$)
if ($expansion);
return '';
} elsif ($command eq 'insertcopying') {
- if ($self->{'extra'} and $self->{'extra'}->{'copying'}) {
+ if ($self->{'global_commands'}
+ and $self->{'global_commands'}->{'copying'}) {
unshift @{$self->{'current_contents'}->[-1]},
- {'contents' => $self->{'extra'}->{'copying'}->{'contents'}};
+ {'contents' => $self->{'global_commands'}->{'copying'}->{'contents'}};
}
return '';
} elsif ($command eq 'printindex') {
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 909dd84..9537a63 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -653,10 +653,11 @@ sub converter($)
my $expanded_formats = $converter->{'EXPANDED_FORMATS'};;
if ($converter->{'parser'}) {
$converter->{'parser_info'} =
$converter->{'parser'}->global_informations();
- $converter->{'extra'} =
$converter->{'parser'}->global_commands_information();
+ $converter->{'global_commands'}
+ = $converter->{'parser'}->global_commands_information();
foreach my $global_command ('documentencoding') {
- if (defined($converter->{'extra'}->{$global_command})) {
- my $root = $converter->{'extra'}->{$global_command}->[0];
+ if (defined($converter->{'global_commands'}->{$global_command})) {
+ my $root = $converter->{'global_commands'}->{$global_command}->[0];
if ($global_command eq 'documentencoding'
and defined($root->{'extra'})
and defined($root->{'extra'}->{'input_perl_encoding'})) {
@@ -717,10 +718,11 @@ sub output($$)
$input_basename =~ s/\.te?x(i|info)?$//;
my $setfilename;
- $setfilename = $self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'}
- if ($self->{'extra'} and $self->{'extra'}->{'setfilename'}
- and $self->{'extra'}->{'setfilename'}->{'extra'}
- and
defined($self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'}));
+ $setfilename
+ = $self->{'global_commands'}->{'setfilename'}->{'extra'}->{'text_arg'}
+ if ($self->{'global_commands'} and
$self->{'global_commands'}->{'setfilename'}
+ and $self->{'global_commands'}->{'setfilename'}->{'extra'}
+ and
defined($self->{'global_commands'}->{'setfilename'}->{'extra'}->{'text_arg'}));
my $outfile;
if (!defined($self->{'OUTFILE'})) {
if (defined($setfilename)) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Converter.pm (converter), tp/Texinfo/Convert/Text.pm (converter), tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm: rename converters field 'extra' as 'global_commands' to be more specific and avoid a field that is already used by tree elements.,
Patrice Dumas <=