texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO texi2any.pl Texinfo/Parser.pm T...


From: Patrice Dumas
Subject: texinfo/tp TODO texi2any.pl Texinfo/Parser.pm T...
Date: Sat, 15 Jan 2011 11:57:02 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/01/15 11:57:02

Modified files:
        tp             : TODO texi2any.pl 
        tp/Texinfo     : Parser.pm Structuring.pm 
        tp/Texinfo/Convert: Info.pm Plaintext.pm Text.pm 
        tp/t/results/macro: macro_in_misc_commands.pl 
        tp/t/results/misc_commands: many_lines.pl 
        tp/t/results/value: value_in_misc_commands.pl 

Log message:
        Support for --number-sections
        Prepare the init customization.
        Distinguish convert that returns some text after expansion of 
@-commands and
        output that outputs the converted text to out files or STDOUT.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.176&r2=1.177
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Info.pm?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Text.pm?cvsroot=texinfo&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_in_misc_commands.pl?cvsroot=texinfo&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/misc_commands/many_lines.pl?cvsroot=texinfo&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/value/value_in_misc_commands.pl?cvsroot=texinfo&r1=1.36&r2=1.37

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- TODO        1 Jan 2011 12:56:16 -0000       1.65
+++ TODO        15 Jan 2011 11:57:01 -0000      1.66
@@ -24,6 +24,30 @@
   -> replace acronym_like with the already formatted text and 
      explanation with convert(explanation).
 
+--html -> 'converter' => sub{Texinfo::Convert::HTML->converter(@_)},
+   $converter->convert($tree);
+--number-sections -> option du convertisseur.
+Config
+--init truc.init
address@hidden (@footnotestyle par exemple)
+
+Texinfo::Config
+le convertisseur a des defauts. Ils sont overriden par les options.
+Depuis un .init, on peut aussi faire qqch du genre
+set_from_init_file('value', val);
+ne fait rien si ca a ete set par une option.
+Pour le savoir il y a besoin de la reference a $converter_default_options.
+C'est passe au debut dans le namespace Texinfo::Config.
+certainement equivalent a qqch comme t2h_default_load_format -- qui doit etre
+appele au debut pour mettre la reference dans le name space.
+Sinon ca set une option dans un autre hash, 
+dans Texinfo::Config::options et Texinfo::Config::options est delete.
+Ensuite Texinfo::Config::options est merge avec le hash de la ligne de 
+commande.
+Qd on est dans le document, une informative command set seulement si ca
+n'a pas ete passe au convertisseur (avec 'set' comme c'est deja fait dans les
+convertisseurs).
+
 Following should be an error:
 @example
 @heading A heading

Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- texi2any.pl 11 Jan 2011 22:59:55 -0000      1.3
+++ texi2any.pl 15 Jan 2011 11:57:01 -0000      1.4
@@ -153,14 +153,121 @@
   push @program_init_dirs, "${texinfo_config_dir}/init";
 }
 
+# Namespace for configuration
+{
+package Texinfo::Config;
+
+my @command_line_settables = ('FILLCOLUMN', 'SPLIT', 'SPLIT_SIZE',
+  'HEADERS',
+  'MACRO_EXPAND', 'NUMBER_SECTIONS',
+  'NUMBER_FOOTNOTES', 'NODE_FILES',
+  'NO_WARN', 'VERBOSE',
+  'TRANSLITERATE_FILE_NAMES', 'ERROR_LIMIT', 'ENABLE_ENCODING',
+  'FORCE', 'INTERNAL_LINKS', 'OUTFILE', 'SUBDIR', 'OUT',
+  'BATCH', 'SILENT'
+);
+
+# FIXME TOP_HEADING_AT_BEGINNING seems to be a no-op
+my @variable_settables = (
+  'DEBUG', 'FRAMES', 'FRAMESET_DOCTYPE', 'DOCTYPE', 'TEST', 'DUMP_TEXI',
+  'TOP_FILE', 'TOC_FILE', 'SHOW_MENU', 'USE_NODES', 'TOC_LINKS', 'SHORTEXTN',
+  'PREFIX', 'SHORT_REF', 'IDX_SUMMARY', 'DEF_TABLE', 'L2H', 'MONOLITHIC',
+  'L2H_L2H', 'L2H_SKIP', 'L2H_TMP', 'L2H_FILE', 'L2H_CLEAN',
+  'L2H_HTML_VERSION', 'IGNORE_PREAMBLE_TEXT', 'EXTERNAL_DIR', 'USE_ISO',
+  'SPLIT_INDEX', 'IN_ENCODING', 'USE_NLS',
+  'VERTICAL_HEAD_NAVIGATION', 'INLINE_CONTENTS', 'NODE_FILE_EXTENSION',
+  'NO_CSS', 'INLINE_CSS_STYLE', 'USE_SECTIONS', 'USE_TITLEPAGE_FOR_TITLE',
+  'SIMPLE_MENU', 'EXTENSION', 'INLINE_INSERTCOPYING', 'USE_NUMERIC_ENTITY',
+  'I18N_PERL_HASH', 'ENABLE_ENCODING_USE_ENTITY', 'ICONS', 'USE_UNICODE',
+  'USE_UNIDECODE', 'DATE_IN_HEADER', 'OPEN_QUOTE_SYMBOL',
+  'CLOSE_QUOTE_SYMBOL', 'TOP_NODE_UP', 'TOP_NODE_FILE',
+  'TOP_NODE_FILE_TARGET', 'SHOW_TITLE', 'WORDS_IN_PAGE',
+  'HEADER_IN_TABLE', 'USE_ACCESSKEY', 'USE_REL_REV', 'USE_LINKS',
+  'OVERVIEW_LINK_TO_TOC', 'AVOID_MENU_REDUNDANCY', 'NODE_NAME_IN_MENU',
+  'NODE_NAME_IN_INDEX', 'USE_SETFILENAME', 'USE_SETFILENAME_EXTENSION',
+  'COMPLEX_FORMAT_IN_TABLE',
+  'USE_UP_FOR_ADJACENT_NODES', 'TOP_HEADING_AT_BEGINNING',
+  'SEPARATE_DESCRIPTION', 'IGNORE_BEFORE_SETFILENAME',
+  'COMPLETE_IMAGE_PATHS', 'USE_NODE_TARGET', 'NEW_CROSSREF_STYLE',
+  'PROGRAM_NAME_IN_FOOTER', 'NODE_FILENAMES', 'DEFAULT_ENCODING',
+  'OUT_ENCODING', 'ENCODING_NAME', 'EXTERNAL_CROSSREF_SPLIT', 'BODYTEXT',
+  'CSS_LINES', 'RENAMED_NODES_REDIRECTIONS', 'RENAMED_NODES_FILE',
+  'TEXI2DVI');
+
+my %valid_options;
+foreach my $var (address@hidden, @document_global_at_commands,
+         @command_line_settables, @variable_settables) {
+  $valid_options{$var} = 1;
+}
+
+
+my ($cmdline_options, $options);
+
+sub _load_config ($) {
+  $cmdline_options = $_[0];
+}
+
+sub load_init_file($$) {
+  my $self = shift;
+  my $file = shift;
+  eval { require($file) ;};
+  if ($@ ne '') {
+    $self->document_warn(sprintf(main::__("error loading %s: %s\n"), 
+                                 $file, $@));
+  }
+}
+
+sub set_from_init_file ($$) {
+  my $var = shift;
+  my $value = shift;
+  if (!$valid_options{$var}) {
+    warn (sprintf(__('Unknown variable %s'), $var));
+    return 0;
+  }
+  return 0 if (defined($cmdline_options->{$var}));
+  $options->{$var} = $value;
+  return 1;
+}
+
+sub set_from_cmdline ($$) {
+  my $var = shift;
+  my $value = shift;
+  delete $options->{$var};
+  if (!$valid_options{$var}) {
+    warn (sprintf(__('Unknown variable %s'), $var));
+    return 0;
+  }
+  $cmdline_options->{$var} = $value;
+  return 1;
+}
+
+# FIXME also get @-command results?
+sub get_conf($) {
+  my $var = shift;
+  if (exists($cmdline_options->{$var})) {
+    return $cmdline_options->{$var};
+  } elsif (exists($options->{$var})) {
+    return $options->{$var};
+  } else {
+    return undef;
+  }
+}
+
+}
+
+sub set_from_cmdline ($$) {
+  return &Texinfo::Config::set_from_cmdline(@_);
+}
+
+sub get_conf ($) {
+  return &Texinfo::Config::get_conf(@_);
+}
+
 my @input_file_suffixes = ('.txi','.texinfo','.texi','.txinfo','');
 
 my @texi2dvi_args = ();
 
 my $macro_expand = undef;
-my $option_force = 0;
-my $option_error_limit = 100;
-my $option_no_warn = 0;
 my $format = 'info';
 # this is the format associated with the output format, which is replaced
 # when the output format changes.  It may also be removed if there is the
@@ -173,6 +280,8 @@
 my $converter_default_options = {};
 my $parser_default_options = {'expanded_formats' => []};
 
+Texinfo::Config::_load_config($parser_default_options);
+
 sub set_expansion($$) {
   my $region = shift;
   my $set = shift;
@@ -187,10 +296,11 @@
   }
 }
 
+
 my $result_options = Getopt::Long::GetOptions (
  'macro-expand|E=s' => sub { push @texi2dvi_args, '-E'; $macro_expand = $_[1]; 
},
- 'error-limit|e=i' => \$option_error_limit,
- 'no-warn' => \$option_no_warn,
+ 'error-limit|e=i' => sub { set_from_cmdline('ERROR_LIMIT', $_[1]); },
+ 'no-warn' => sub { set_from_cmdline('NO_WARN', $_[1]); },
  'ifhtml' => sub { set_expansion('html', $_[1]); },
  'ifinfo' => sub { set_expansion('info', $_[1]); },
  'ifxml' => sub { set_expansion('xml', $_[1]); },
@@ -201,7 +311,8 @@
                 push @include_dirs, split(/$quoted_path_separator/, $_[1]); },
  'conf-dir=s' => sub { push @conf_dirs, split(/$quoted_path_separator/, 
$_[1]); },
  'P=s' => sub { unshift @prepend_dirs, split(/$quoted_path_separator/, $_[1]); 
},
-# 'number-sections' => 
+ 'number-sections' => sub { set_from_cmdline('NUMBER_SECTIONS', $_[1]); },
+ 'plaintext' => sub {$format = 'plaintext';},
 );
 
 my %formats_table = (
@@ -234,18 +345,19 @@
   $error_count += $new_error_count if ($new_error_count);
   foreach my $error_message (@$errors) {
     warn $error_message->{'error_line'} if ($error_message->{'type'} eq 'error'
-                                           or !$option_no_warn);
+                                           or !get_conf('NO_WARN'));
   }
   
-  exit (1) if ($error_count and (!$option_force
-     or $error_count > $option_error_limit));
+  exit (1) if ($error_count and (!get_conf('FORCE')
+     or $error_count > get_conf('ERROR_LIMIT')));
   return $error_count;
 }
 
-my $file_number = 0;
+my $file_number = -1;
 # main processing
 while(@input_files)
 {
+  $file_number++;
   my $input_file_arg = shift(@input_files);
   my $input_file_name;
   # try to concatenate with different suffixes. The last suffix is ''
@@ -274,6 +386,7 @@
   unshift @{$parser_options->{'include_directories'}}, @prepend_dirs;
 
   $parser_options->{'gettext'} = \&__;
+
   my $parser = Texinfo::Parser::parser($parser_options);
   my $tree = $parser->parse_texi_file($input_file_name);
 
@@ -294,11 +407,10 @@
       warn (sprintf(__("Could not open %s for writing: %s\n"), 
                     $macro_expand, $!));
       $error_count++;
-      exit (1) if ($error_count and (!$option_force
-         or $error_count > $option_error_limit));
+      exit (1) if ($error_count and (!get_conf('FORCE')
+         or $error_count > get_conf('ERROR_LIMIT')));
     }
   }
-  $file_number++;
   # every format needs the sectioning structure
   my $structure = Texinfo::Structuring::sectioning_structure($parser, $tree);
   # this can be done for every format, since information is already gathered
@@ -314,9 +426,12 @@
   $error_count = handle_errors($parser, $error_count);
 
   my $converter_options = { %$converter_default_options };
+  if (get_conf('OUTFILE') and $file_number == 0) {
+    $converter_options->{'outfile'} = get_conf('OUTFILE');
+  }
   $converter_options->{'parser'} = $parser;
   my $converter = 
&{$formats_table{$format}->{'converter'}}($converter_options);
-  $converter->convert($tree);
+  $converter->output($tree);
   handle_errors($converter, $error_count);
 }
 

Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -b -r1.176 -r1.177
--- Texinfo/Parser.pm   11 Jan 2011 22:59:55 -0000      1.176
+++ Texinfo/Parser.pm   15 Jan 2011 11:57:01 -0000      1.177
@@ -372,16 +372,22 @@
 
 my %global_multiple_commands;
 foreach my $global_multiple_command ('author', 'documentlanguage', 
-  'subtitle', 'contents', 'shortcontents', 'summarycontents') {
+  'subtitle', 'contents', 'shortcontents', 'summarycontents',
+  'kbdinputstyle', 'paragraphindent', 'firstparagraphindent',
+  'frenchspacing', 'footnotestyle') {
   $global_multiple_commands{$global_multiple_command} = 1;
 }
 
 my %global_unique_commands;
 foreach my $global_unique_command ('documentencoding', 'title', 
-  'shorttitlepage', 'settitle', 'copying', 'documentdescription', 'titlepage',
+  'shorttitlepage', 'settitle', 'copying', 'documentdescription',
+  'novalidate', 'titlepage',
   'setfilename', 'setcontentsaftertitlepage', 
-  'setshortcontentsaftertitlepage', 'paragraphindent', 'firstparagraphindent',
-  'frenchspacing', 'documentencoding', 'footnotestyle') {
+  'setshortcontentsaftertitlepage',
+  'documentencoding', 'everyheadingmarks','everyfootingmarks',
+  'evenheadingmarks', 'oddheadingmarks', 'evenfootingmarks', 'oddfootingmarks',
+  'fonttextsize', 'pagesizes', 'setchapternewpage'
+) {
   $global_unique_commands{$global_unique_command} = 1;
 }
 

Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- Texinfo/Structuring.pm      9 Jan 2011 22:02:33 -0000       1.27
+++ Texinfo/Structuring.pm      15 Jan 2011 11:57:02 -0000      1.28
@@ -189,7 +189,7 @@
   my $section_top;
   
   # holds the current number for all the levels.  It is not possible to use
-  # something like the last child index, because of @unnumber.
+  # something like the last child index, because of @unnumbered.
   my @command_numbers;
   foreach my $content (@{$root->{'contents'}}) {
     if ($content->{'cmdname'} and $content->{'cmdname'} ne 'node'

Index: Texinfo/Convert/Info.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Info.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- Texinfo/Convert/Info.pm     11 Jan 2011 22:59:55 -0000      1.9
+++ Texinfo/Convert/Info.pm     15 Jan 2011 11:57:02 -0000      1.10
@@ -49,7 +49,7 @@
 my $STDIN_DOCU_NAME = 'stdin';
 my $INFO_EXTENSION = 'info';
 
-sub convert($)
+sub output($)
 {
   my $self = shift;
   my $root = shift;
@@ -171,21 +171,20 @@
   $input_basename =~ s/^.*\///;
   $input_basename = $STDIN_DOCU_NAME if ($input_basename eq '-');
   my $output_file;
-  if (defined($self->{'output_file'})) {
-    $output_file = $self->{'output_file'};
+  if (defined($self->{'OUTFILE'})) {
+    $output_file = $self->{'OUTFILE'};
   } elsif ($self->{'extra'} and $self->{'extra'}->{'setfilename'}
            and $self->{'extra'}->{'setfilename'}->{'extra'}
            and 
defined($self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'})) {
     $output_file = $self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'};
-    $self->{'output_file'} = $output_file;
   } elsif ($input_basename ne '') {
     $output_file = $input_basename;
     $output_file =~ s/\.te?x(i|info)?$//;
     $output_file .= '.'.$INFO_EXTENSION;
-    $self->{'output_file'} = $output_file;
   } else {
     $output_file = '';
   }
+  $self->{'output_file'} = $output_file if ($output_file ne '');
   my $output_basename = $output_file;
   $output_basename =~ s/^.*\///;
   $self->{'output_filename'} = $output_basename;

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- Texinfo/Convert/Plaintext.pm        9 Jan 2011 22:02:34 -0000       1.49
+++ Texinfo/Convert/Plaintext.pm        15 Jan 2011 11:57:02 -0000      1.50
@@ -46,6 +46,7 @@
 # will save memory.
 %EXPORT_TAGS = ( 'all' => [ qw(
   convert
+  output
 ) ] );
 
 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@@ -244,6 +245,7 @@
   'split_size'           => 300000,
   'expanded_formats'     => undef,
   'include_directories'  => undef,
+  'NUMBER_SECTIONS'      => 1,
 
   'debug'                => 0,
   'test'                 => 0,
@@ -342,8 +344,13 @@
                and $converter->{'structuring'}->{'sectioning_root'});
       $converter->{'gettext'} = $converter->{'parser'}->{'gettext'};
       foreach my $global_command (@informative_global_commands) {
-        
$converter->_informative_command($converter->{'extra'}->{$global_command})
-          if (defined($converter->{'extra'}->{$global_command}));
+        if (defined($converter->{'extra'}->{$global_command})) {
+          my $root = $converter->{'extra'}->{$global_command};
+          if (ref($root) eq 'ARRAY') {
+            $root = $converter->{'extra'}->{$global_command}->[0];
+          }
+          $converter->_informative_command($root);
+        }
       }
       delete $conf->{'parser'};
     }
@@ -424,7 +431,7 @@
   return ($result, {'lines' => $lines_count, 'bytes' => $bytes_count});
 }
 
-sub convert($)
+sub convert($$)
 {
   my $self = shift;
   my $root = shift;
@@ -442,9 +449,36 @@
       $result .= $node_text;
     }
   }
+
   return $result;
 }
 
+sub output($$)
+{
+  my $self = shift;
+  my $root = shift;
+
+  my $outfile = '-';
+  if (defined($self->{'OUTFILE'})) {
+    $outfile = $self->{'OUTFILE'};
+  }
+  
+  my $fh = $self->Texinfo::Common::open_out ($outfile,
+                                             $self->{'encoding'});
+  if (!$fh) {
+    $self->document_error(sprintf($self->__("Could not open %s for writing: 
$!"),
+                                  $outfile));
+    return undef;
+  }
+  my $result = $self->convert($root);
+  if (defined($result)) {
+    print $fh $result;
+    return $self;
+  } else {
+    return undef;
+  }
+}
+
 sub _normalise_space($)
 {
   return undef unless (defined ($_[0]));
@@ -778,7 +812,7 @@
     my ($section_title) = $self->convert_line({'contents'
                 => $section->{'extra'}->{'misc_content'}});
     my $text = Texinfo::Convert::Text::numbered_heading($section, 
-                                                        $section_title)."\n";
+                            $section_title, $self->{'NUMBER_SECTIONS'})."\n";
     $result .= (' ' x (2*($section->{'level'} - ($root_level+1)))) . $text;
     if ($section->{'section_childs'} 
           and ($contents or $section->{'level'} < $root_level+1)) {
@@ -1248,7 +1282,7 @@
     } elsif ($command eq 'titlefont') {
       ($result) = $self->convert_line ($root->{'args'}->[0]);
       $result = Texinfo::Convert::Text::heading({'level' => 0, 
-           'cmdname' => 'titlefont'}, $result);
+           'cmdname' => 'titlefont'}, $result, $self->{'NUMBER_SECTIONS'});
       $self->{'empty_lines_count'} = 0 unless ($result eq '');
       return ($result, {'bytes' => $self->count_bytes($result),
                        'lines' => 2});
@@ -1349,7 +1383,8 @@
       if ($root->{'args'}) {
         my ($heading) = $self->convert_line($root->{'args'}->[0]);
         my $heading_underlined = 
-             Texinfo::Convert::Text::heading ($root, $heading);
+             Texinfo::Convert::Text::heading ($root, $heading, 
+                                              $self->{'NUMBER_SECTIONS'});
         $self->{'empty_lines_count'} = 0 unless ($heading_underlined eq '');
         $bytes_count += $self->count_bytes($heading_underlined);
         # FIXME address@hidden and @c?

Index: Texinfo/Convert/Text.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Text.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- Texinfo/Convert/Text.pm     9 Jan 2011 11:55:06 -0000       1.29
+++ Texinfo/Convert/Text.pm     15 Jan 2011 11:57:02 -0000      1.30
@@ -873,12 +873,14 @@
   4 => '.'
 );
 
-sub numbered_heading($$)
+sub numbered_heading($$$)
 {
   my $current = shift;
   my $text = shift;
+  my $numbered = shift;
 
-  $text = $current->{'number'}.' '.$text if (defined($current->{'number'}));
+  $text = $current->{'number'}.' '.$text if (defined($current->{'number'}) 
+                                         and ($numbered or 
!defined($numbered)));
   if ($current->{'cmdname'} eq 'appendix' and $current->{'level'} == 1) {
     # FIXME i18n
     $text = 'Appendix '.$text;
@@ -887,12 +889,13 @@
   return $text;
 }
 
-sub heading($$)
+sub heading($$$)
 {
   my $current = shift;
   my $text = shift;
+  my $numbered = shift;
 
-  $text = numbered_heading($current, $text);
+  $text = numbered_heading($current, $text, $numbered);
   return '' if ($text !~ /\S/);
   my $result = $text ."\n";
   $result .=($underline_symbol{$current->{'level'}} 
@@ -982,7 +985,7 @@
       } elsif ($root->{'cmdname'} ne 'node') {
         $result = convert($root->{'args'}->[0], $options);
         if ($Texinfo::Common::sectioning_commands{$root->{'cmdname'}}) {
-          $result = heading ($root, $result);
+          $result = heading ($root, $result, $options->{'NUMBER_SECTIONS'});
         } else {
         # we always want an end of line even if is was eaten by a 
           chomp ($result);

Index: t/results/macro/macro_in_misc_commands.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/macro/macro_in_misc_commands.pl,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- t/results/macro/macro_in_misc_commands.pl   1 Jan 2011 14:28:01 -0000       
1.43
+++ t/results/macro/macro_in_misc_commands.pl   15 Jan 2011 11:57:02 -0000      
1.44
@@ -3996,51 +3996,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':99: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 99,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':100: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 100,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':101: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 101,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':112: warning: Multiple @footnotestyle
-',
-    'file_name' => '',
-    'line_nr' => 112,
-    'macro' => '',
-    'text' => 'Multiple @footnotestyle',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':121: warning: Multiple @frenchspacing
-',
-    'file_name' => '',
-    'line_nr' => 121,
-    'macro' => '',
-    'text' => 'Multiple @frenchspacing',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':149: warning: @page should only appear at a line 
beginning (possibly involving @page-macro)
 ',
     'file_name' => '',

Index: t/results/misc_commands/many_lines.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/misc_commands/many_lines.pl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- t/results/misc_commands/many_lines.pl       30 Dec 2010 17:36:51 -0000      
1.25
+++ t/results/misc_commands/many_lines.pl       15 Jan 2011 11:57:02 -0000      
1.26
@@ -1610,15 +1610,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':21: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 21,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':22: warning: @paragraphindent should only appear at a 
line beginning
 ',
     'file_name' => '',
@@ -1628,15 +1619,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':22: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 22,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':23: warning: @paragraphindent should only appear at a 
line beginning
 ',
     'file_name' => '',
@@ -1646,15 +1628,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':23: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 23,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':24: warning: @firstparagraphindent should only appear at 
a line beginning
 ',
     'file_name' => '',
@@ -1700,15 +1673,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':28: warning: Multiple @footnotestyle
-',
-    'file_name' => '',
-    'line_nr' => 28,
-    'macro' => '',
-    'text' => 'Multiple @footnotestyle',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':29: warning: @documentencoding should only appear at a 
line beginning
 ',
     'file_name' => '',
@@ -1763,15 +1727,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':32: warning: Multiple @frenchspacing
-',
-    'file_name' => '',
-    'line_nr' => 32,
-    'macro' => '',
-    'text' => 'Multiple @frenchspacing',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':33: warning: @fonttextsize should only appear at a line 
beginning
 ',
     'file_name' => '',

Index: t/results/value/value_in_misc_commands.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/value/value_in_misc_commands.pl,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- t/results/value/value_in_misc_commands.pl   1 Jan 2011 14:28:02 -0000       
1.36
+++ t/results/value/value_in_misc_commands.pl   15 Jan 2011 11:57:02 -0000      
1.37
@@ -3261,42 +3261,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':71: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 71,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':72: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 72,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':73: warning: Multiple @paragraphindent
-',
-    'file_name' => '',
-    'line_nr' => 73,
-    'macro' => '',
-    'text' => 'Multiple @paragraphindent',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':80: warning: Multiple @footnotestyle
-',
-    'file_name' => '',
-    'line_nr' => 80,
-    'macro' => '',
-    'text' => 'Multiple @footnotestyle',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':88: warning: @documentlanguage should only appear at a 
line beginning
 ',
     'file_name' => '',
@@ -3306,15 +3270,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':97: warning: Multiple @frenchspacing
-',
-    'file_name' => '',
-    'line_nr' => 97,
-    'macro' => '',
-    'text' => 'Multiple @frenchspacing',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':115: warning: @page should only appear at a line 
beginning
 ',
     'file_name' => '',



reply via email to

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