[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve... |
Date: |
Sat, 19 Mar 2011 10:09:35 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/03/19 10:09:34
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/Texinfo/Convert: Plaintext.pm
tp/t : 02coverage.t 30sectioning.t
tp/t/results/sectioning: at_commands_in_refs.pl
Added files:
tp/t/results/coverage: test_today.pl
Log message:
Handle @today.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.112&r2=1.113
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.224&r2=1.225
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.117&r2=1.118
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/30sectioning.t?cvsroot=texinfo&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/test_today.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl?cvsroot=texinfo&r1=1.36&r2=1.37
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- TODO 17 Mar 2011 21:01:01 -0000 1.112
+++ TODO 19 Mar 2011 10:09:33 -0000 1.113
@@ -72,6 +72,10 @@
Use PREFIX to override setfilename/input file name to determine output
name? Isn't -o sufficient? Or call it 'setfilename'?
+Punctuation and spaces before @image do not lead to a doubling of space.
+
+Use INLINE_INSERTCOPYING as the default for some formats?
+
Force end lines before/after a menu?
With something like
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -b -r1.224 -r1.225
--- Texinfo/Parser.pm 19 Mar 2011 00:04:27 -0000 1.224
+++ Texinfo/Parser.pm 19 Mar 2011 10:09:33 -0000 1.225
@@ -73,6 +73,7 @@
global_commands_information
global_informations
expand_verbatiminclude
+ expand_today
gdt
) ] );
@@ -4417,6 +4418,47 @@
return $verbatiminclude;
}
+my @MONTH_NAMES =
+ (
+ 'January', 'February', 'March', 'April', 'May',
+ 'June', 'July', 'August', 'September', 'October',
+ 'November', 'December'
+ );
+
+# This is not used as code, but used to mark months as strings to be
+# translated
+if (0) {
+ my $self;
+ my @mark_month_for_translation = (
+ $self->gdt('January'),
+ $self->gdt('February'),
+ $self->gdt('March'),
+ $self->gdt('April'),
+ $self->gdt('May'),
+ $self->gdt('June'),
+ $self->gdt('July'),
+ $self->gdt('August'),
+ $self->gdt('September'),
+ $self->gdt('October'),
+ $self->gdt('November'),
+ $self->gdt('December')
+ );
+}
+
+sub expand_today($)
+{
+ my $self = shift;
+ if ($self->{'TEST'}) {
+ return {'text' => 'a sunny day'};
+ }
+ my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
+ = localtime(time);
+ $year += ($year < 70) ? 2000 : 1900;
+ return $self->gdt('{month} {day}, {year}',
+ { 'month' => $self->gdt($MONTH_NAMES[$mon]),
+ 'day' => $mday, 'year' => $year });
+}
+
1;
__END__
# Below is stub documentation.
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- Texinfo/Convert/Plaintext.pm 15 Mar 2011 22:27:49 -0000 1.117
+++ Texinfo/Convert/Plaintext.pm 19 Mar 2011 10:09:33 -0000 1.118
@@ -1294,6 +1294,9 @@
$formatter->{'container'}->add_text($text_no_brace_commands{$command}));
}
return $result;
+ } elsif ($root->{'cmdname'} eq 'today') {
+ my $today = Texinfo::Parser::expand_today($self);
+ unshift @{$self->{'current_contents'}->[-1]}, $today;
} elsif (defined($text_brace_no_arg_commands{$root->{'cmdname'}})) {
my $text = Texinfo::Convert::Text::brace_no_arg_command($root,
$self->{'encoding_name'});
Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- t/02coverage.t 17 Mar 2011 21:01:02 -0000 1.43
+++ t/02coverage.t 19 Mar 2011 10:09:34 -0000 1.44
@@ -484,6 +484,8 @@
['test_tie',
'address@hidden
'],
+['test_today',
+'@today{}.', {}, {'TEST' => 1}]
);
my @test_invalid = (
@@ -662,7 +664,7 @@
);
foreach my $test (@test_cases) {
- $test->[2]->{'test_formats'} = ['plaintext'];
+ push @{$test->[2]->{'test_formats'}}, 'plaintext';
}
our ($arg_test_case, $arg_generate, $arg_debug);
Index: t/30sectioning.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/30sectioning.t,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- t/30sectioning.t 13 Mar 2011 22:01:23 -0000 1.32
+++ t/30sectioning.t 19 Mar 2011 10:09:34 -0000 1.33
@@ -483,7 +483,7 @@
@address@hidden://somewhere_aaa} @url{url, text} @uref{/man.cgi/1/ls,,ls}}
@bye
-'],
+', {}, {'TEST' => 1}],
['double_node_anchor_float',
'@node node1
@@ -1235,7 +1235,7 @@
);
foreach my $test (@tests_converted) {
- $test->[2]->{'test_formats'} = ['plaintext'];
+ push @{$test->[2]->{'test_formats'}}, 'plaintext';
}
foreach my $test (@tests_info) {
push @{$test->[2]->{'test_formats'}}, 'info';
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.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- t/results/sectioning/at_commands_in_refs.pl 6 Mar 2011 14:44:08 -0000
1.36
+++ t/results/sectioning/at_commands_in_refs.pl 19 Mar 2011 10:09:34 -0000
1.37
@@ -19608,7 +19608,7 @@
* == error--> Euro ! ==> -::
* >= <= ->::
* a o -!- # -| ? (R)::
-* => o a b aa::
+* => o a b a sunny day aa::
* AA ae oe AE OE /o /O ss /l /L D d TH th::
* a" e~ i^ a^ a` e\' c, e= e* e\'\' e;::
* e. e( e_ .e e< j ee[::
@@ -19662,19 +19662,19 @@
**********
-File: , Node: a o -!- # -| ? (R), Next: => o a b aa, Prev: >= <= ->, Up:
Top
+File: , Node: a o -!- # -| ? (R), Next: => o a b a sunny day aa, Prev: >=
<= ->, Up: Top
6 a o -!- # -| ? (R)
********************
-File: , Node: => o a b aa, Next: AA ae oe AE OE /o /O ss /l /L D d TH th,
Prev: a o -!- # -| ? (R), Up: Top
+File: , Node: => o a b a sunny day aa, Next: AA ae oe AE OE /o /O ss /l /L D
d TH th, Prev: a o -!- # -| ? (R), Up: Top
-7 => o a b aa
-*************
+7 => o a b a sunny day aa
+*************************
-File: , Node: AA ae oe AE OE /o /O ss /l /L D d TH th, Next: a" e~ i^ a^ a`
e\' c, e= e* e\'\' e;, Prev: => o a b aa, Up: Top
+File: , Node: AA ae oe AE OE /o /O ss /l /L D d TH th, Next: a" e~ i^ a^ a`
e\' c, e= e* e\'\' e;, Prev: => o a b a sunny day aa, Up: Top
8 AA ae oe AE OE /o /O ss /l /L D d TH th
*****************************************
@@ -19784,45 +19784,45 @@
*note >= <= ->::
- *note a o -!- # -| ? (R):: *note => o a b aa:: *note AA ae oe AE OE
-/o /O ss /l /L D d TH th:: *note a" e~ i^ a^ a` e\' c, e= e* e\'\' e;::
-*note e. e( e_ .e e< j ee[:: *note `` \'\' ` \' ,, ,:: *note << >> << >> <
->:: *note `` \'\' --- --:: *note AAA (fff) AAA BBB:: *note CCC (rrr) CCC
-DDD:: *note the someone <address@hidden> <address@hidden>:: *note [image
src="f--ile.png" alt="alt" text="[Image description\\"\\"\\\\.]"