[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Report.pm Texinfo/Convert/Pl...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Report.pm Texinfo/Convert/Pl... |
Date: |
Tue, 01 Mar 2011 00:16:36 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/03/01 00:16:35
Modified files:
tp/Texinfo : Report.pm
tp/Texinfo/Convert: Plaintext.pm
tp/t : 30sectioning.t
tp/t/results/info_tests: top_node_normalization.pl
tp/t/results/sectioning: at_commands_in_refs.pl
character_and_spaces_in_refs.pl
equivalent_nodes.pl space_in_node.pl
top_node_no_menu_direction.pl
Log message:
Keep user formatting in menu entry node and warn for node with a
different
formatting (because of different at-commands).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Report.pm?cvsroot=texinfo&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.102&r2=1.103
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/30sectioning.t?cvsroot=texinfo&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/top_node_normalization.pl?cvsroot=texinfo&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl?cvsroot=texinfo&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/character_and_spaces_in_refs.pl?cvsroot=texinfo&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/equivalent_nodes.pl?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/space_in_node.pl?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/top_node_no_menu_direction.pl?cvsroot=texinfo&r1=1.1&r2=1.2
Patches:
Index: Texinfo/Report.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Report.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- Texinfo/Report.pm 23 Jan 2011 21:18:26 -0000 1.5
+++ Texinfo/Report.pm 1 Mar 2011 00:16:34 -0000 1.6
@@ -139,6 +139,4 @@
$self->{'error_nrs'}++;
}
-
-
1;
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- Texinfo/Convert/Plaintext.pm 28 Feb 2011 22:00:16 -0000 1.102
+++ Texinfo/Convert/Plaintext.pm 1 Mar 2011 00:16:34 -0000 1.103
@@ -2162,19 +2162,42 @@
and !$root->{'extra'}->{'menu_entry_node'}->{'manual_content'}
and $self->{'labels'}
and
$self->{'labels'}->{$root->{'extra'}->{'menu_entry_node'}->{'normalized'}}) {
- $menu_entry_internal_node =
$self->{'labels'}->{$root->{'extra'}->{'menu_entry_node'}->{'normalized'}};
+ $menu_entry_internal_node
+ =
$self->{'labels'}->{$root->{'extra'}->{'menu_entry_node'}->{'normalized'}};
}
foreach my $arg (@{$root->{'args'}}) {
if ($arg->{'type'} eq 'menu_entry_node') {
- #Â if it is an internal ref, get the real node target name
- my $node_contents;
if ($menu_entry_internal_node) {
- $node_contents =
$menu_entry_internal_node->{'extra'}->{'node_content'};
- } else {
- $node_contents = $arg->{'contents'};
+ #Â check that after space collapse the info reader will find the
+ #Â node. But always expand what the user provided for the
+ #Â menu entry, to keep the user defined spacing.
+ my $saved_error_nrs = $self->{'error_nrs'};
+ my $saved_error_errors_warnings = $self->{'errors_warnings'};
+ $self->{'errors_warnings'} = [];
+ push @{$self->{'count_context'}}, {'lines' => 0, 'bytes' => 0};
+ my $internal_node = Texinfo::Convert::Info::_normalize_top_node(
+ $self->convert_line({'type' => 'code',
+ 'contents'
+ => $menu_entry_internal_node->{'extra'}->{'node_content'}}));
+ my $menu_node = Texinfo::Convert::Info::_normalize_top_node(
+ $self->convert_line({'type' => 'code',
+ 'contents'
+ => $arg->{'contents'}}));
+ $self->{'error_nrs'} = $saved_error_nrs;
+ $self->{'errors_warnings'} = $saved_error_errors_warnings;
+ # trailing spaces for node in menu are not very predictable.
+ #Â therefore they are ignored, and they are ignored in both
+ #Â case, in case there where protected spaces at the end of a node.
+ $internal_node =~ s/\s*$//;
+ $menu_node =~ s/\s*$//;
+ if ($internal_node ne $menu_node) {
+ $self->line_warn(sprintf($self->__("Node expansion `%s' in menu
differs from normal node expansion `%s'"),
+ $menu_node, $internal_node), $root->{'line_nr'});
+ }
+ pop @{$self->{'count_context'}};
}
$result .= $self->_convert({'type' => 'code',
- 'contents' => $node_contents});
+ 'contents' => $arg->{'contents'}});
} else {
$result .= $self->_convert($arg);
}
Index: t/30sectioning.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/30sectioning.t,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- t/30sectioning.t 28 Feb 2011 22:00:17 -0000 1.30
+++ t/30sectioning.t 1 Mar 2011 00:16:34 -0000 1.31
@@ -710,6 +710,22 @@
['section_in_unnumbered_info',
$section_in_unnumbered_text
],
+['space_in_node',
+'
address@hidden Top
+
address@hidden
+* Chap first here::
+* Test title :Test title.
+* Last with spaces ::
address@hidden menu
+
address@hidden Chap first here
+
address@hidden Test title
+
address@hidden Last with spaces
+'],
);
my @test_cases = (
@@ -725,19 +741,6 @@
@node arg1 @comma{} arg2, @,cedilla, @strong{comma in strong,} @c comma , end
'],
-['space_in_node',
-'
address@hidden Top
-
address@hidden
-* Chap first here::
-* Test title :Test title.
address@hidden menu
-
address@hidden Chap first here
-
address@hidden Test title
-'],
['empty_nodes_with_commands',
'
@node @c comment
Index: t/results/info_tests/top_node_normalization.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/info_tests/top_node_normalization.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- t/results/info_tests/top_node_normalization.pl 27 Feb 2011 17:28:58
-0000 1.4
+++ t/results/info_tests/top_node_normalization.pl 1 Mar 2011 00:16:35
-0000 1.5
@@ -346,7 +346,7 @@
* Menu:
-* ToP::
+* tOP::
Tag Table:
Index: t/results/sectioning/at_commands_in_refs.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- t/results/sectioning/at_commands_in_refs.pl 27 Feb 2011 17:28:58 -0000
1.32
+++ t/results/sectioning/at_commands_in_refs.pl 1 Mar 2011 00:16:35 -0000
1.33
@@ -19745,31 +19745,31 @@
Tag Table:
Node: Top52
-Node: { }823
+Node: { }819
Node: !
-. . ? @902
-Node: LaTeX TeX * , (C) ... ...1023
-Node: == error--> Euro ! ==> -1189
-Node: >= <= ->1348
-Node: a o -!- # -| ? (R)1468
-Node: => o a b aa1595
-Node: AA ae oe AE OE /o /O ss /l /L D d TH th1739
-Node: a" e~ i^ a^ a` e\' c, e= e* e\'\' e;1954
-Node: e. e( e_ .e e< j ee[2166
-Node: `` \'\' ` \' ,, ,2329
-Node: << >> << >> < >2462
-Node: `` \'\' --- --2589
-Node: AAA (fff) AAA BBB2705
-Node: CCC (rrr) CCC DDD2841
-Node: the someone <address@hidden> <address@hidden>3014
-Node: [image src="f--ile.png" alt="alt" text="[Image
description\\"\\"\\\\.]"