texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Common.pm Texinfo/Parser.pm ...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Common.pm Texinfo/Parser.pm ...
Date: Sun, 30 Oct 2011 10:41:46 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/10/30 10:41:46

Modified files:
        tp/Texinfo     : Common.pm Parser.pm Structuring.pm 
        tp/t/results/indices: empty_index_entry.pl 
        tp/t/results/sectioning: section_before_part.pl 
                                 section_node_before_part.pl 

Log message:
        Warn when there are sectioning element before the first @part but none
        at the level of chapter.
        
        Don't return empty index entries when sorting them.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.86&r2=1.87
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.326&r2=1.327
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.100&r2=1.101
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/indices/empty_index_entry.pl?cvsroot=texinfo&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/section_before_part.pl?cvsroot=texinfo&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/section_node_before_part.pl?cvsroot=texinfo&r1=1.14&r2=1.15

Patches:
Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -b -r1.86 -r1.87
--- Texinfo/Common.pm   30 Oct 2011 10:13:19 -0000      1.86
+++ Texinfo/Common.pm   30 Oct 2011 10:41:45 -0000      1.87
@@ -113,7 +113,7 @@
   'ENCODING_NAME', 'PERL_ENCODING', 'INDICES', 'KBDINPUTSTYLE', 'LABELS',
   'MACROS', 'NOVALIDATE', 'SECTIONS_LEVEL', 'VALUES');
 
-# TODO warn when those variables are used?
+# FIXME(Karl) warn when those variables are used?
 my @obsolete_variables = ('TOP_HEADING_AT_BEGINNING', 'USE_SECTIONS',
   'IDX_SUMMARY', 'I18N_PERL_HASH', 'USE_UNICODE', 'USE_NLS',
   'USE_UP_FOR_ADJACENT_NODES', 'SEPARATE_DESCRIPTION', 
@@ -144,7 +144,7 @@
   'PROGRAM_NAME_IN_FOOTER', 'NODE_FILENAMES', 'DEFAULT_ENCODING',
   'OUT_ENCODING', 'ENCODING_NAME', 'EXTERNAL_CROSSREF_SPLIT', 'BODYTEXT',
   'CSS_LINES', 'RENAMED_NODES_REDIRECTIONS', 'RENAMED_NODES_FILE',
-# TODO new, document?
+# FIXME new. To be documented.
   'TEXI2DVI', 'DUMP_TREE', 'MAX_MACRO_CALL_NESTING',
   'CPP_LINE_DIRECTIVES',
   'PROGRAM_AND_VERSION', 'PROGRAM_HOMEPAGE', 'PROGRAM',

Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.326
retrieving revision 1.327
diff -u -b -r1.326 -r1.327
--- Texinfo/Parser.pm   30 Oct 2011 00:51:17 -0000      1.326
+++ Texinfo/Parser.pm   30 Oct 2011 10:41:45 -0000      1.327
@@ -3288,8 +3288,8 @@
                          'extra' => {'line' => $line }};
           $current = $current->{'contents'}->[-1];
           last;
-          # FIXME accept only a command at the line beginning?
-          # FIXME accept only one space after @end?
+          # FIXME(Karl) accept only a command at the line beginning?
+          # FIXME(Karl) accept only one space after @end?
         } elsif ($line =~ /^(.*?)address@hidden([a-zA-Z][\w-]*)/
                  and ($2 eq $current->{'cmdname'})) {
           my $end_command = $2;
@@ -4106,7 +4106,7 @@
                                                 'contents' => [] };
               $current = $current->{'contents'}->[-1];
             }
-            # FIXME ignore what is remaining on the line, to eat 
+            # FIXME(Karl) ignore what is remaining on the line, to eat 
             # the end of line?
             last;
           } else {

Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -b -r1.100 -r1.101
--- Texinfo/Structuring.pm      30 Oct 2011 10:13:19 -0000      1.100
+++ Texinfo/Structuring.pm      30 Oct 2011 10:41:45 -0000      1.101
@@ -246,7 +246,10 @@
               if ($content->{'cmdname'} eq 'part') {
                 $new_upper_element = 1;
                 if ($level < $up->{'level'}) {
-                  # FIXME warn previous element too low
+                  # FIXME(Karl) error message
+                  $self->line_warn(sprintf($self->__(
+                    "No chapter-level command before address@hidden"),
+                          $content->{'cmdname'}), $content->{'line_nr'});
                 }
               } else {
                 $self->line_error(sprintf($self->__(
@@ -338,7 +341,7 @@
 }
 
 my @node_directions = ('next', 'prev', 'up');
-# FIXME i18n?
+# FIXME(Karl) i18n?
 my %direction_texts = (
  'prev' => 'Prev',
  'next' => 'Next',
@@ -649,7 +652,6 @@
         $elements->[-1]->{'extra'}->{'element_command'} 
           = $new_section;
       }
-    # FIXME Handle part differently? (associate with prev sectioning command?)
     } elsif ($content->{'cmdname'} and $content->{'cmdname'} ne 'node' 
                                    and $content->{'cmdname'} ne 'bye') {
       if ($current->{'extra'}->{'no_section'}) {
@@ -857,7 +859,6 @@
 
       # fastforward is the next element on same level than the upper parent
       # element.
-      # FIXME and for parts?
       if ($up->{'level'} < 1 and $up->{'cmdname'} and $up->{'cmdname'} eq 'top'
           and $up->{'section_childs'} and @{$up->{'section_childs'}}) {
         $directions->{'FastForward'} = 
$up->{'section_childs'}->[0]->{'parent'};
@@ -878,7 +879,7 @@
       }
     }
     # Use node up for Up if there is no section up.
-    # FIXME is it really right?
+    # FIXME(Karl) is it really right?
     if (!$directions->{'Up'} and $element->{'extra'}->{'node'}
         and $element->{'extra'}->{'node'}->{'node_up'} 
         and (!$node_top or ($element->{'extra'}->{'node'} ne $node_top))) {
@@ -1134,7 +1135,6 @@
   }
 }
 
-# FIXME empty index entries are kept here, but not when sorting by letter.
 sub sort_indices($$$)
 {
   my $self = shift;
@@ -1144,7 +1144,8 @@
   _do_index_keys($self, $index_entries, $index_names);
   foreach my $index_name (keys(%$index_entries)) {
     @{$sorted_index_entries->{$index_name}} = 
-        sort _sort_index_entries @{$index_entries->{$index_name}};
+        sort _sort_index_entries 
+            grep {$_->{'key'} =~ /\S/} @{$index_entries->{$index_name}};
   }
   return $sorted_index_entries;
 }

Index: t/results/indices/empty_index_entry.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/indices/empty_index_entry.pl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- t/results/indices/empty_index_entry.pl      29 Oct 2011 16:38:06 -0000      
1.13
+++ t/results/indices/empty_index_entry.pl      30 Oct 2011 10:41:46 -0000      
1.14
@@ -367,10 +367,6 @@
 
  -- :
 
-[index]
-* Menu:
-
-
 
 
 Tag Table:

Index: t/results/sectioning/section_before_part.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/sectioning/section_before_part.pl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- t/results/sectioning/section_before_part.pl 11 Oct 2011 22:41:59 -0000      
1.13
+++ t/results/sectioning/section_before_part.pl 30 Oct 2011 10:41:46 -0000      
1.14
@@ -174,7 +174,17 @@
 $result_sectioning{'section_before_part'}{'section_childs'}[0]{'section_up'} = 
$result_sectioning{'section_before_part'};
 $result_sectioning{'section_before_part'}{'section_childs'}[1]{'section_up'} = 
$result_sectioning{'section_before_part'};
 
-$result_errors{'section_before_part'} = [];
+$result_errors{'section_before_part'} = [
+  {
+    'error_line' => ':3: warning: No chapter-level command before @part
+',
+    'file_name' => '',
+    'line_nr' => 3,
+    'macro' => '',
+    'text' => 'No chapter-level command before @part',
+    'type' => 'warning'
+  }
+];
 
 
 

Index: t/results/sectioning/section_node_before_part.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/sectioning/section_node_before_part.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- t/results/sectioning/section_node_before_part.pl    11 Oct 2011 22:42:00 
-0000      1.14
+++ t/results/sectioning/section_node_before_part.pl    30 Oct 2011 10:41:46 
-0000      1.15
@@ -264,7 +264,17 @@
   }
 };
 
-$result_errors{'section_node_before_part'} = [];
+$result_errors{'section_node_before_part'} = [
+  {
+    'error_line' => ':5: warning: No chapter-level command before @part
+',
+    'file_name' => '',
+    'line_nr' => 5,
+    'macro' => '',
+    'text' => 'No chapter-level command before @part',
+    'type' => 'warning'
+  }
+];
 
 
 



reply via email to

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