[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Convert/Line.pm Texinfo...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Convert/Line.pm Texinfo... |
Date: |
Thu, 17 Feb 2011 20:07:35 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/17 20:07:35
Modified files:
tp : TODO
tp/Texinfo/Convert: Line.pm Paragraph.pm Plaintext.pm
UnFilled.pm
tp/t : 05paragraph.t info_tests.t
tp/t/results/coverage_braces: space_in_image.pl
Added files:
tp/t/results/info_tests: image_in_paragraph.pl
Log message:
Flush spaces and text before @image.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.84&r2=1.85
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Line.pm?cvsroot=texinfo&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Paragraph.pm?cvsroot=texinfo&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.84&r2=1.85
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/UnFilled.pm?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/05paragraph.t?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/info_tests.t?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage_braces/space_in_image.pl?cvsroot=texinfo&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/image_in_paragraph.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- TODO 15 Feb 2011 21:40:30 -0000 1.84
+++ TODO 17 Feb 2011 20:07:34 -0000 1.85
@@ -1,3 +1,8 @@
+Handle
address@hidden
+(does nothing in info, in HTML automatically set the section name as 3rd
+arg of @*ref).
+
Before the release, verify that everything on
https://savannah.gnu.org/bugs/?group=texinfo
is fixed and tested for.
@@ -38,6 +43,14 @@
Force end lines before/after a menu?
+With something like
address@hidden { category}
+the space is stripped everywhere but in sorting. Should be stripped in
+sorting too.
+
+Is the following error right? Or maybe it should be a warning?
+test_setfilename.texi:5: @top missing argument
+
Test empty/no empty line at a multitable beginning, between 2 rows and
after a multitable.
Index: Texinfo/Convert/Line.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Line.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- Texinfo/Convert/Line.pm 16 Feb 2011 22:16:15 -0000 1.17
+++ Texinfo/Convert/Line.pm 17 Feb 2011 20:07:34 -0000 1.18
@@ -100,19 +100,22 @@
return $result;
}
-sub add_pending_word($)
+sub add_pending_word($;$)
{
my $line = shift;
+ my $add_spaces = shift;
$line->{'end_line_count'} = 0;
- return $line->_add_pending_word();
+ return $line->_add_pending_word($add_spaces);
}
+
# put a pending word and spaces in the result string.
sub _add_pending_word($)
{
my $line = shift;
+ my $add_spaces = shift;
my $result = '';
- if (defined($line->{'word'})) {
+ if (defined($line->{'word'}) or $add_spaces) {
if ($line->{'line_beginning'}) {
if ($line->{'indent_length'}) {
$result .= ' ' x ($line->{'indent_length'} - $line->{'counter'});
@@ -124,10 +127,12 @@
print STDERR "ADD_SPACES.L\n" if ($line->{'DEBUG'});
}
$line->{'space'} = '';
+ if (defined($line->{'word'})) {
$result .= $line->{'word'};
print STDERR "ADD_WORD.L[$line->{'word'}]\n" if ($line->{'DEBUG'});
$line->{'word'} = undef;
}
+ }
return $result;
}
Index: Texinfo/Convert/Paragraph.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Paragraph.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- Texinfo/Convert/Paragraph.pm 14 Feb 2011 23:50:03 -0000 1.18
+++ Texinfo/Convert/Paragraph.pm 17 Feb 2011 20:07:34 -0000 1.19
@@ -105,20 +105,22 @@
return $result;
}
-sub add_pending_word($)
+sub add_pending_word($;$)
{
my $paragraph = shift;
+ my $add_spaces = shift;
$paragraph->{'end_line_count'} = 0;
- return $paragraph->_add_pending_word();
+ return $paragraph->_add_pending_word($add_spaces);
}
# put a pending word and spaces in the result string.
-sub _add_pending_word($)
+sub _add_pending_word($;$)
{
my $paragraph = shift;
+ my $add_spaces = shift;
my $result = '';
- if (defined($paragraph->{'word'})) {
+ if (defined($paragraph->{'word'}) or $add_spaces) {
if ($paragraph->{'indent_length'} > $paragraph->{'counter'}) {
$result .= ' ' x ($paragraph->{'indent_length'} -
$paragraph->{'counter'});
$paragraph->{'counter'} = $paragraph->{'indent_length'};
@@ -131,12 +133,14 @@
if ($paragraph->{'DEBUG'});
}
+ if (defined($paragraph->{'word'})) {
$result .= $paragraph->{'word'};
$paragraph->{'counter'} += $paragraph->{'word_counter'};
print STDERR "ADD_WORD[$paragraph->{'word'}]+$paragraph->{'word_counter'}
($paragraph->{'counter'})\n"
if ($paragraph->{'DEBUG'});
$paragraph->{'word'} = undef;
$paragraph->{'word_counter'} = 0;
+ }
$paragraph->{'space'} = '';
}
return $result;
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- Texinfo/Convert/Plaintext.pm 16 Feb 2011 22:33:10 -0000 1.84
+++ Texinfo/Convert/Plaintext.pm 17 Feb 2011 20:07:34 -0000 1.85
@@ -1304,13 +1304,15 @@
$formatter->{'upper_case'}-- if ($upper_case_commands{$command});
return $result;
} elsif ($root->{'cmdname'} eq 'image') {
- my $lines_count;
- ($result, $lines_count) = $self->_image($root);
+ $result = $self->_count_added($formatter->{'container'},
+ $formatter->{'container'}->add_pending_word(1));
+ my ($image, $lines_count) = $self->_image($root);
$self->_add_lines_count($lines_count);
- $self->_add_text_count($result);
- if ($result ne '' and $formatter->{'type'} ne 'paragraph') {
+ $self->_add_text_count($image);
+ if ($image ne '' and $formatter->{'type'} ne 'paragraph') {
$self->{'empty_lines_count'} = 0;
}
+ $result .= $image;
return $result;
} elsif ($root->{'cmdname'} eq 'email') {
# nothing is output for email, instead the command is substituted.
Index: Texinfo/Convert/UnFilled.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/UnFilled.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- Texinfo/Convert/UnFilled.pm 5 Feb 2011 19:56:12 -0000 1.8
+++ Texinfo/Convert/UnFilled.pm 17 Feb 2011 20:07:35 -0000 1.9
@@ -121,10 +121,19 @@
}
# put a pending word and spaces in the result string.
-sub add_pending_word($)
+sub add_pending_word($;$)
{
my $line = shift;
+ my $add_spaces = shift;
$line->{'end_line_count'} = 0;
+ if ($add_spaces) {
+ #Â this set the indentation, if needed
+ $line->_add_text('');
+ my $text = $line->{'leading_spaces'};
+ $line->{'leading_spaces'} = '';
+ return $text;
+ }
+
return '';
}
Index: t/05paragraph.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/05paragraph.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- t/05paragraph.t 14 Feb 2011 23:50:09 -0000 1.10
+++ t/05paragraph.t 17 Feb 2011 20:07:35 -0000 1.11
@@ -24,6 +24,9 @@
@b{aaa}.
'],
+['image_in_paragraph',
+'Para. @image{aa,bb,cc,dd,ee}. After image.
+'],
['close_paragraph_command',
'para @titlefont{in titlefont} after titlefont.
Index: t/info_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/info_tests.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/info_tests.t 16 Feb 2011 22:16:15 -0000 1.8
+++ t/info_tests.t 17 Feb 2011 20:07:35 -0000 1.9
@@ -88,6 +88,12 @@
@image{f--ile,,,alt""\\}
'],
+['image_in_paragraph',
+'@node Top
+
+Para.
address@hidden,,,alt""\\}. End para.
+'],
[ 'multitable_anchor_and_index_entry',
'@node Top
Index: t/results/coverage_braces/space_in_image.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/coverage_braces/space_in_image.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- t/results/coverage_braces/space_in_image.pl 28 Dec 2010 19:05:02 -0000
1.14
+++ t/results/coverage_braces/space_in_image.pl 17 Feb 2011 20:07:35 -0000
1.15
@@ -197,7 +197,7 @@
-$result_converted{'plaintext'}->{'space_in_image'} = 'An image text before
paragraph..[Another image text, in paragraph.] .
+$result_converted{'plaintext'}->{'space_in_image'} = 'An image text before
paragraph.. [Another image text, in paragraph.].
';
1;
Index: t/results/info_tests/image_in_paragraph.pl
===================================================================
RCS file: t/results/info_tests/image_in_paragraph.pl
diff -N t/results/info_tests/image_in_paragraph.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/info_tests/image_in_paragraph.pl 17 Feb 2011 20:07:35 -0000
1.1
@@ -0,0 +1,214 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors);
+
+$result_trees{'image_in_paragraph'} = {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'text_root'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Top'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'Para.
+'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'f--ile'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'alt""\\'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'image',
+ 'contents' => [],
+ 'extra' => {
+ 'brace_command_contents' => [
+ [
+ {}
+ ],
+ undef,
+ undef,
+ [
+ {}
+ ]
+ ]
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '. End para.
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'image_in_paragraph'}{'contents'}[0]{'parent'} =
$result_trees{'image_in_paragraph'};
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'image_in_paragraph'}{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[0]{'parent'} =
$result_trees{'image_in_paragraph'}{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[2]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'parent'}
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'extra'}{'brace_command_contents'}[0][0]
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'extra'}{'brace_command_contents'}[3][0]
=
$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'contents'}[0];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'parent'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'contents'}[1]{'parent'} =
$result_trees{'image_in_paragraph'}{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'extra'}{'node_content'}[0]
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'args'}[0]{'contents'}[1];
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}
= $result_trees{'image_in_paragraph'}{'contents'}[1]{'extra'}{'node_content'};
+$result_trees{'image_in_paragraph'}{'contents'}[1]{'parent'} =
$result_trees{'image_in_paragraph'};
+
+$result_texis{'image_in_paragraph'} = '@node Top
+
+Para.
address@hidden,,,alt""\\}. End para.
+';
+
+
+$result_texts{'image_in_paragraph'} = '
+Para.
+f--ile. End para.
+';
+
+$result_sectioning{'image_in_paragraph'} = {};
+
+$result_nodes{'image_in_paragraph'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'node_up' => {
+ 'extra' => {
+ 'manual_content' => [
+ {
+ 'text' => 'dir'
+ }
+ ]
+ }
+ }
+};
+
+$result_menus{'image_in_paragraph'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+};
+
+$result_errors{'image_in_paragraph'} = [];
+
+
+
+$result_converted{'info'}->{'image_in_paragraph'} = 'This is , produced by
makeinfo version 4.13 from .
+
+
+File: , Node: Top, Up: (dir)
+
+Para. [image src="f--ile.png" alt="alt\\"\\"\\\\" text="[Image
description\\"\\"\\\\.]"