[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Common.pm (%document_settable_unique
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Common.pm (%document_settable_unique_at_commands), tp/Texinfo/Convert/LaTeX.pm (@informative_global_commands) (_convert), tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/parser.c (register_global_command), tp/Texinfo/XS/parsetexi/parser.h (GLOBAL_INFO): set @afourpaper, @afourlatex, @afourwide, @afivepaper, @bsixpaper and @smallbook as global unique @-commands. |
Date: |
Sat, 01 Jan 2022 10:22:07 -0500 |
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 d5694cc1c5 * tp/Texinfo/Common.pm
(%document_settable_unique_at_commands), tp/Texinfo/Convert/LaTeX.pm
(@informative_global_commands) (_convert),
tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/parser.c
(register_global_command), tp/Texinfo/XS/parsetexi/parser.h (GLOBAL_INFO): set
@afourpaper, @afourlatex, @afourwide, @afivepaper, @bsixpaper and @smallbook as
global unique @-commands.
d5694cc1c5 is described below
commit d5694cc1c56dc6a80bf5702742c6d583aef058ef
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 1 16:21:56 2022 +0100
* tp/Texinfo/Common.pm (%document_settable_unique_at_commands),
tp/Texinfo/Convert/LaTeX.pm (@informative_global_commands)
(_convert), tp/Texinfo/XS/parsetexi/command_data.txt,
tp/Texinfo/XS/parsetexi/parser.c (register_global_command),
tp/Texinfo/XS/parsetexi/parser.h (GLOBAL_INFO): set @afourpaper,
@afourlatex, @afourwide, @afivepaper, @bsixpaper and @smallbook
as global unique @-commands.
---
ChangeLog | 10 ++++++++
tp/Texinfo/Common.pm | 7 +++++-
tp/Texinfo/Convert/LaTeX.pm | 18 +++++----------
tp/Texinfo/XS/parsetexi/command_data.txt | 12 +++++-----
tp/Texinfo/XS/parsetexi/parser.c | 6 +++++
tp/Texinfo/XS/parsetexi/parser.h | 6 +++++
tp/t/results/latex_tests/pagetype.pl | 29 ++++++++++++++++++++++++
tp/t/results/macro/macro_in_misc_commands.pl | 5 ++++
tp/t/results/misc_commands/many_lines.pl | 34 ++++++++++++++++++++++++++++
tp/t/results/value/value_in_misc_commands.pl | 5 ++++
10 files changed, 113 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a235a8ca28..05b1464612 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-01-01 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Common.pm (%document_settable_unique_at_commands),
+ tp/Texinfo/Convert/LaTeX.pm (@informative_global_commands)
+ (_convert), tp/Texinfo/XS/parsetexi/command_data.txt,
+ tp/Texinfo/XS/parsetexi/parser.c (register_global_command),
+ tp/Texinfo/XS/parsetexi/parser.h (GLOBAL_INFO): set @afourpaper,
+ @afourlatex, @afourwide, @afivepaper, @bsixpaper and @smallbook
+ as global unique @-commands.
+
2022-01-01 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Structuring.pm (split_by_node, split_by_section):
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 96a71fd302..a22967e4f9 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -171,7 +171,12 @@ our %document_settable_unique_at_commands = (
'pagesizes' => undef,
'setchapternewpage' => 'on',
'setfilename' => undef,
- # FIXME add afourpaper and similar?
+ 'afourpaper' => undef,
+ 'afourlatex' => undef,
+ 'afourwide' => undef,
+ 'afivepaper' => undef,
+ 'bsixpaper' => undef,
+ 'smallbook' => undef,
);
# a value corresponds to defaults that are the same for every output format
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 177b01b763..2df6a2950d 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -200,11 +200,8 @@ my @informative_global_commands = ('paragraphindent',
'firstparagraphindent',
'frenchspacing', 'documentencoding', 'footnotestyle', 'documentlanguage',
'contents', 'shortcontents', 'summarycontents', 'deftypefnnewline',
'allowcodebreaks', 'kbdinputstyle', 'setchapternewpage', 'headings',
-'xrefautomaticsectiontitle', 'fonttextsize', 'pagesizes',
+'xrefautomaticsectiontitle', 'fonttextsize', 'pagesizes',
sort(keys(%paper_geometry_commands))
);
-# FIXME paper geometry commands are not in
Texinfo::Common::document_settable_unique_at_commands
-# thus not in valid_options.
-#sort(keys(%paper_geometry_commands)));
my %informative_commands;
foreach my $informative_command (@informative_global_commands) {
@@ -244,14 +241,13 @@ my %in_heading_commands =
%Texinfo::Common::in_heading_commands;
# commands that can appear in preamble, before \begin{document}
my %preamble_commands;
foreach my $preamble_command ('hyphenation', 'anchor', 'errormsg',
- 'inlineraw', '*',
- keys(%paper_geometry_commands), @informative_global_commands,
+ 'inlineraw', '*', @informative_global_commands,
keys(%format_raw_commands), keys(%inline_commands)) {
$preamble_commands{$preamble_command} = 1;
}
-foreach my $kept_command (keys(%informative_commands),
- keys(%default_index_commands), keys(%paper_geometry_commands),
+foreach my $kept_command (@informative_global_commands,
+ keys(%default_index_commands),
keys(%headings_specification_commands), keys(%in_heading_commands),
'verbatiminclude', 'insertcopying',
'listoffloats', 'printindex', 'indent', 'noindent', 'need', 'page',
@@ -2924,10 +2920,6 @@ sub _convert($$)
$result .= '';
}
return $result;
- # FIXME right now not informative commands
- } elsif ($paper_geometry_commands{$cmdname}) {
- $result .= "\\geometry{$paper_geometry_commands{$cmdname}}%\n";
- return $result;
} elsif ($headings_specification_commands{$cmdname}) {
if ($element->{'args'} and $element->{'args'}->[0]
and $element->{'args'}->[0]->{'contents'}) {
@@ -2998,6 +2990,8 @@ sub _convert($$)
my $fontsize = $element->{'extra'}->{'misc_args'}->[0];
# default dimension for changefontsize is pt
$result .= "\\changefontsize{$fontsize}\n";
+ } elsif ($paper_geometry_commands{$cmdname}) {
+ $result .= "\\geometry{$paper_geometry_commands{$cmdname}}%\n";
}
return $result;
} else {
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt
b/tp/Texinfo/XS/parsetexi/command_data.txt
index acf1859daa..865c347d8a 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -96,11 +96,11 @@ allowcodebreaks line,global 1
exampleindent line,global 1
footnotestyle line,global_unique 1
urefbreakstyle line,global 1
-afourpaper line LINE_skipline
-afivepaper line LINE_skipline
-afourlatex line LINE_skipline
-afourwide line LINE_skipline
-bsixpaper line LINE_skipline
+afourpaper line,global_unique LINE_skipline
+afivepaper line,global_unique LINE_skipline
+afourlatex line,global_unique LINE_skipline
+afourwide line,global_unique LINE_skipline
+bsixpaper line,global_unique LINE_skipline
headings line,global 1
setchapternewpage line,global_unique 1
@@ -111,7 +111,7 @@ evenfooting line,global
LINE_heading_spec
oddheading line,global LINE_heading_spec
oddfooting line,global LINE_heading_spec
-smallbook line LINE_skipline
+smallbook line,global_unique LINE_skipline
syncodeindex line 2
synindex line 2
defindex line 1
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 8e21ddff15..f5b05ab70d 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -260,6 +260,12 @@ register_global_command (ELEMENT *current)
GLOBAL_UNIQUE_CASE(shorttitlepage);
GLOBAL_UNIQUE_CASE(title);
GLOBAL_UNIQUE_CASE(novalidate);
+ GLOBAL_UNIQUE_CASE(afourpaper);
+ GLOBAL_UNIQUE_CASE(afourlatex);
+ GLOBAL_UNIQUE_CASE(afourwide);
+ GLOBAL_UNIQUE_CASE(afivepaper);
+ GLOBAL_UNIQUE_CASE(bsixpaper);
+ GLOBAL_UNIQUE_CASE(smallbook);
#undef GLOBAL_UNIQUE_CASE
/* NOTE: Same list in api.c:build_global_info2 and wipe_global_info. */
default:
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index e6572a5e36..44ce393b1f 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -63,6 +63,12 @@ typedef struct GLOBAL_INFO {
ELEMENT *oddfootingmarks;
ELEMENT *shorttitlepage;
ELEMENT *novalidate;
+ ELEMENT *afourpaper;
+ ELEMENT *afourlatex;
+ ELEMENT *afourwide;
+ ELEMENT *afivepaper;
+ ELEMENT *bsixpaper;
+ ELEMENT *smallbook;
/* Arrays of elements */
ELEMENT footnotes;
diff --git a/tp/t/results/latex_tests/pagetype.pl
b/tp/t/results/latex_tests/pagetype.pl
index c646c5b353..be23993029 100644
--- a/tp/t/results/latex_tests/pagetype.pl
+++ b/tp/t/results/latex_tests/pagetype.pl
@@ -54,6 +54,11 @@ $result_trees{'pagetype'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -72,6 +77,11 @@ $result_trees{'pagetype'} = {
}
],
'cmdname' => 'afourwide',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -237,6 +247,11 @@ $result_trees{'pagetype'} = {
}
],
'cmdname' => 'smallbook',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 13,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -279,6 +294,11 @@ $result_trees{'pagetype'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 18,
+ 'macro' => ''
+ },
'parent' => {}
}
],
@@ -586,6 +606,15 @@ $result_errors{'pagetype'} = [
'macro' => '',
'text' => 'unknown command `Chapter\'',
'type' => 'error'
+ },
+ {
+ 'error_line' => ':18: warning: multiple @afourpaper
+',
+ 'file_name' => '',
+ 'line_nr' => 18,
+ 'macro' => '',
+ 'text' => 'multiple @afourpaper',
+ 'type' => 'warning'
}
];
diff --git a/tp/t/results/macro/macro_in_misc_commands.pl
b/tp/t/results/macro/macro_in_misc_commands.pl
index 3d1e286bfa..a534d578c2 100644
--- a/tp/t/results/macro/macro_in_misc_commands.pl
+++ b/tp/t/results/macro/macro_in_misc_commands.pl
@@ -557,6 +557,11 @@ $result_trees{'macro_in_misc_commands'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 38,
+ 'macro' => 'afourpapermacro'
+ },
'parent' => {}
},
{
diff --git a/tp/t/results/misc_commands/many_lines.pl
b/tp/t/results/misc_commands/many_lines.pl
index 5f837e300f..81fcf3a22f 100644
--- a/tp/t/results/misc_commands/many_lines.pl
+++ b/tp/t/results/misc_commands/many_lines.pl
@@ -65,6 +65,11 @@ $result_trees{'many_lines'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -81,6 +86,11 @@ $result_trees{'many_lines'} = {
}
],
'cmdname' => 'smallbook',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -484,6 +494,11 @@ $result_trees{'many_lines'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 17,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -500,6 +515,11 @@ $result_trees{'many_lines'} = {
}
],
'cmdname' => 'afourlatex',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 18,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -516,6 +536,11 @@ $result_trees{'many_lines'} = {
}
],
'cmdname' => 'afourwide',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => ''
+ },
'parent' => {}
},
{
@@ -1600,6 +1625,15 @@ $result_errors{'many_lines'} = [
'text' => '@afourpaper should only appear at the beginning of a line',
'type' => 'warning'
},
+ {
+ 'error_line' => ':17: warning: multiple @afourpaper
+',
+ 'file_name' => '',
+ 'line_nr' => 17,
+ 'macro' => '',
+ 'text' => 'multiple @afourpaper',
+ 'type' => 'warning'
+ },
{
'error_line' => ':18: warning: @afourlatex should only appear at the
beginning of a line
',
diff --git a/tp/t/results/value/value_in_misc_commands.pl
b/tp/t/results/value/value_in_misc_commands.pl
index 768ffbec24..3cec2102b2 100644
--- a/tp/t/results/value/value_in_misc_commands.pl
+++ b/tp/t/results/value/value_in_misc_commands.pl
@@ -281,6 +281,11 @@ $result_trees{'value_in_misc_commands'} = {
}
],
'cmdname' => 'afourpaper',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 16,
+ 'macro' => ''
+ },
'parent' => {}
},
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Common.pm (%document_settable_unique_at_commands), tp/Texinfo/Convert/LaTeX.pm (@informative_global_commands) (_convert), tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/parser.c (register_global_command), tp/Texinfo/XS/parsetexi/parser.h (GLOBAL_INFO): set @afourpaper, @afourlatex, @afourwide, @afivepaper, @bsixpaper and @smallbook as global unique @-commands.,
Patrice Dumas <=