texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp Texinfo/Common.pm Texinfo/Convert/Co...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Common.pm Texinfo/Convert/Co...
Date: Tue, 02 Aug 2011 21:01:35 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/08/02 21:01:35

Modified files:
        tp/Texinfo     : Common.pm 
        tp/Texinfo/Convert: Converter.pm HTML.pm Plaintext.pm Text.pm 
        tp/t           : test_sort.t test_utils.pl 
        tp/t/results/coverage: test_today.pl 
        tp/t/results/sectioning: at_commands_in_refs.pl 

Log message:
        Handle @today{} better in Converter::Text.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Converter.pm?cvsroot=texinfo&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.118&r2=1.119
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.142&r2=1.143
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Text.pm?cvsroot=texinfo&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_sort.t?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_utils.pl?cvsroot=texinfo&r1=1.87&r2=1.88
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/test_today.pl?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl?cvsroot=texinfo&r1=1.43&r2=1.44

Patches:
Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- Texinfo/Common.pm   27 Jul 2011 00:16:00 -0000      1.51
+++ Texinfo/Common.pm   2 Aug 2011 21:01:33 -0000       1.52
@@ -138,6 +138,7 @@
   'NODE_FOOTER_BUTTONS',
   'MISC_BUTTONS', 'CHAPTER_BUTTONS', 'BUTTONS_NAME',
   'BUTTONS_EXAMPLE', 'SPECIAL_ELEMENTS_NAME',
+  'ACTIVE_ICONS', 'PASSIVE_ICONS',
   'DEFAULT_RULE', 'BIG_RULE',
   'MENU_ENTRY_COLON', 'INDEX_ENTRY_COLON', 'MENU_SYMBOL', 'DO_ABOUT',
   'CSS_FILES', 'CSS_REFS');
@@ -701,6 +702,13 @@
   $encoding_aliases{$eight_bit_encoding_aliases{$encoding}} = $encoding;
 }
 
+our @MONTH_NAMES =
+    (
+     'January', 'February', 'March', 'April', 'May',
+     'June', 'July', 'August', 'September', 'October',
+     'November', 'December'
+    );
+
 sub locate_include_file($$)
 {
   my $self = shift;
@@ -822,6 +830,20 @@
   }
 }
 
+sub expand_today($)
+{
+  my $self = shift;
+  if ($self->get_conf('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 });
+}
+
 sub definition_arguments_content($)
 {
   my $root = shift;

Index: Texinfo/Convert/Converter.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Converter.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- Texinfo/Convert/Converter.pm        5 Jun 2011 14:03:48 -0000       1.22
+++ Texinfo/Convert/Converter.pm        2 Aug 2011 21:01:34 -0000       1.23
@@ -357,13 +357,6 @@
   }
 }
 
-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) {
@@ -418,20 +411,6 @@
   return $verbatiminclude;
 }
 
-sub expand_today($)
-{
-  my $self = shift;
-  if ($self->get_conf('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 });
-}
-
 sub _create_destination_directory($)
 {
   my $self = shift;

Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -b -r1.118 -r1.119
--- Texinfo/Convert/HTML.pm     31 Jul 2011 23:21:49 -0000      1.118
+++ Texinfo/Convert/HTML.pm     2 Aug 2011 21:01:34 -0000       1.119
@@ -1130,7 +1130,7 @@
   my $cmdname = shift;
   my $command = shift;
 
-  my $tree = $self->expand_today();
+  my $tree = $self->Texinfo::Common::expand_today();
   return $self->convert_tree($tree);
 }
 

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -b -r1.142 -r1.143
--- Texinfo/Convert/Plaintext.pm        4 Jun 2011 17:02:22 -0000       1.142
+++ Texinfo/Convert/Plaintext.pm        2 Aug 2011 21:01:34 -0000       1.143
@@ -1205,7 +1205,7 @@
       }
       return $result;
     } elsif ($root->{'cmdname'} eq 'today') {
-      my $today = $self->expand_today();
+      my $today = $self->Texinfo::Common::expand_today();
       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, 

Index: Texinfo/Convert/Text.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Text.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- Texinfo/Convert/Text.pm     21 Jul 2011 09:21:24 -0000      1.42
+++ Texinfo/Convert/Text.pm     2 Aug 2011 21:01:34 -0000       1.43
@@ -954,6 +954,21 @@
     my $command = $root->{'cmdname'};
     if (defined($text_no_brace_commands{$root->{'cmdname'}})) {
       return $text_no_brace_commands{$root->{'cmdname'}};
+    } elsif ($root->{'cmdname'} eq 'today') {
+      if ($options->{'sort_string'} 
+          and $sort_brace_no_arg_commands{$root->{'cmdname'}}) {
+        return $sort_brace_no_arg_commands{$root->{'cmdname'}};
+      } elsif ($options->{'converter'}) {
+        return convert(Texinfo::Common::expand_today($options->{'converter'}),
+                       $options);
+      } elsif ($options->{'TEST'}) {
+        return 'a sunny day';
+      } else {
+        my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
+          = localtime(time);
+        $year += ($year < 70) ? 2000 : 1900;
+        return "$Texinfo::Common::MONTH_NAMES[$mon] $mday, $year";
+      }
     } elsif (defined($text_brace_no_arg_commands{$root->{'cmdname'}})) {
       return brace_no_arg_command($root, $options->{'enabled_encoding'}, 
                                   $options->{'sort_string'});

Index: t/test_sort.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/test_sort.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- t/test_sort.t       21 Jul 2011 09:21:25 -0000      1.7
+++ t/test_sort.t       2 Aug 2011 21:01:34 -0000       1.8
@@ -42,7 +42,7 @@
 
 my ($index_names, $merged_indices, $index_entries) = 
    $parser->indices_information();
-my $sorted_index_entries = Texinfo::Structuring::sort_indices($tree, 
$index_entries);
+my $sorted_index_entries = Texinfo::Structuring::sort_indices($parser, 
$index_entries);
 
 my @entries = ();
 foreach my $entry (@{$sorted_index_entries->{'cp'}}) {
@@ -55,7 +55,7 @@
 cmp_deeply (address@hidden, address@hidden, 'sorted index entries');
 
 my $sorted_index_entries_by_letter 
-  = Texinfo::Structuring::sort_indices_by_letter($tree, $index_entries);
+  = Texinfo::Structuring::sort_indices_by_letter($parser, $index_entries);
 
 my @letter_entries_ref = (
    {'!' => [ '!' ]},

Index: t/test_utils.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/test_utils.pl,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- t/test_utils.pl     27 Jul 2011 00:16:01 -0000      1.87
+++ t/test_utils.pl     2 Aug 2011 21:01:34 -0000       1.88
@@ -380,7 +380,7 @@
   $indices->{'merged_indices'} = $merged_indices
     unless (Data::Compare::Compare($merged_indices, $initial_merged_indices));
 
-  my $converted_text = Texinfo::Convert::Text::convert($result);
+  my $converted_text = Texinfo::Convert::Text::convert($result, {'TEST' => 1});
 
   my %converted;
   my %converted_errors;

Index: t/results/coverage/test_today.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/coverage/test_today.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/coverage/test_today.pl    3 Jul 2011 14:50:54 -0000       1.3
+++ t/results/coverage/test_today.pl    2 Aug 2011 21:01:34 -0000       1.4
@@ -40,7 +40,7 @@
 $result_texis{'test_today'} = '@today{}.';
 
 
-$result_texts{'test_today'} = '.';
+$result_texts{'test_today'} = 'a sunny day.';
 
 $result_errors{'test_today'} = [];
 

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.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- t/results/sectioning/at_commands_in_refs.pl 9 Jul 2011 06:35:41 -0000       
1.43
+++ t/results/sectioning/at_commands_in_refs.pl 2 Aug 2011 21:01:34 -0000       
1.44
@@ -18594,7 +18594,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[::
@@ -18632,8 +18632,8 @@
 6 a o -!- # -| ? (R)
 ********************
 
-7 => o a b  aa
-**************
+7 => o a b a sunny day aa
+*************************
 
 8 AA ae oe AE OE /o /O ss /l /L D d TH th
 *****************************************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]