texinfo-commits
[Top][All Lists]
Advanced

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

texinfo ChangeLog doc/texinfo.txi tp/TODO tp/te...


From: Patrice Dumas
Subject: texinfo ChangeLog doc/texinfo.txi tp/TODO tp/te...
Date: Tue, 07 Feb 2012 19:41:39 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/02/07 19:41:39

Modified files:
        .              : ChangeLog 
        doc            : texinfo.txi 
        tp             : TODO texi2any.pl 
        tp/Texinfo     : Common.pm 

Log message:
                * doc/texinfo.txi (Configuration Variables), 
tp/Texinfo/Common.pm, 
                tp/texi2any.pl:
                new customization variable, TREE_TRANSFORMATIONS, to specify
                transformations done to the tree before output.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/ChangeLog?cvsroot=texinfo&r1=1.1323&r2=1.1324
http://cvs.savannah.gnu.org/viewcvs/texinfo/doc/texinfo.txi?cvsroot=texinfo&r1=1.418&r2=1.419
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.262&r2=1.263
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.127&r2=1.128

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1323
retrieving revision 1.1324
diff -u -b -r1.1323 -r1.1324
--- ChangeLog   7 Feb 2012 00:40:46 -0000       1.1323
+++ ChangeLog   7 Feb 2012 19:41:38 -0000       1.1324
@@ -4,6 +4,10 @@
        tp/Texinfo/Convert/PlainTexinfo.pm, tp/Makefile.am: new converter,
        converting the tree to Texinfo.  Add a FIX_TEXINFO customization
        variable for this converter, set in the default case.
+       * doc/texinfo.txi (Configuration Variables), tp/Texinfo/Common.pm, 
+       tp/texi2any.pl:
+       new customization variable, TREE_TRANSFORMATIONS, to specify
+       transformations done to the tree before output.
 
 2012-02-05  Patrice Dumas  <address@hidden>
 

Index: doc/texinfo.txi
===================================================================
RCS file: /sources/texinfo/texinfo/doc/texinfo.txi,v
retrieving revision 1.418
retrieving revision 1.419
diff -u -b -r1.418 -r1.419
--- doc/texinfo.txi     7 Feb 2012 00:40:45 -0000       1.418
+++ doc/texinfo.txi     7 Feb 2012 19:41:38 -0000       1.419
@@ -1,5 +1,5 @@
 \input texinfo.tex    @c -*-texinfo-*-
address@hidden $Id: texinfo.txi,v 1.418 2012/02/07 00:40:45 pertusus Exp $
address@hidden $Id: texinfo.txi,v 1.419 2012/02/07 19:41:38 pertusus Exp $
 @c Ordinarily, Texinfo files have the extension .texi.  But texinfo.texi
 @c clashes with texinfo.tex on 8.3 filesystems, so we use texinfo.txi.
 
@@ -17539,8 +17539,9 @@
 For address@hidden  If set, output the title at the beginning of the document.
 
 @item SIMPLE_MENU
-If set, use a simple preformatted style for the menu, instead of
-breaking down the different parts of the menu.  @xref{Menu Parts}.
+For address@hidden  If set, use a simple preformatted style for the menu, 
+instead of breaking down the different parts of the menu.
address@hidden Parts}.
 
 @item SORT_ELEMENT_COUNT
 If set, the name of a file to which a list of elements (nodes or
@@ -17596,6 +17597,24 @@
 @item TOP_NODE_FILE_TARGET
 File used for the Top node in cross references.
 
address@hidden TREE_TRANSFORMATIONS
+The associated value is a comma separated list of transformations applied
+to the texinfo tree prior from outputting the result.  The following 
+transformations are currently supported:
+
address@hidden @samp
address@hidden fill_gaps_in_sectioning
+Adds empty @code{@@unnumbered} in a tree to fill gaps in sectioning.
+For example, an @code{@@unnumberedsec} will be inserted if a @code{@@chapter}
+is followed by a @code{subsection}.
+
address@hidden simple_menu
+Does the same as @code{SIMPLE_MENU}: use a simple preformatted style for the 
+menu.  It differs from setting @code{SIMPLE_MENU}, as @code{SIMPLE_MENU}
+will only have an effect for address@hidden
+
address@hidden table
+
 @item USE_ACCESSKEY
 @cindex @code{accesskey}, configuration variable for
 For address@hidden  Use @code{accesskey} in cross references.
@@ -21622,7 +21641,7 @@
 Revision Control System}) or other version control systems, which
 expand it into a string such as:
 @example
-$Id: texinfo.txi,v 1.418 2012/02/07 00:40:45 pertusus Exp $
+$Id: texinfo.txi,v 1.419 2012/02/07 19:41:38 pertusus Exp $
 @end example
 (This is useful in all sources that use version control, not just manuals.)
 You may wish to include the @samp{$Id:} comment in the @code{@@copying}

Index: tp/TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -b -r1.262 -r1.263
--- tp/TODO     6 Feb 2012 23:22:59 -0000       1.262
+++ tp/TODO     7 Feb 2012 19:41:38 -0000       1.263
@@ -9,8 +9,6 @@
 
 pod2texi: remove :: in node to avoid confusing @ref in info.
 
-Converter that simply converts to Texinfo.
-
 
 Bugs
 ====

Index: tp/texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- tp/texi2any.pl      7 Feb 2012 00:40:47 -0000       1.110
+++ tp/texi2any.pl      7 Feb 2012 19:41:39 -0000       1.111
@@ -870,6 +870,19 @@
   exec { get_conf('TEXI2DVI') } (get_conf('TEXI2DVI'), @texi2dvi_args,  @ARGV);
 }
 
+my %tree_transformations;
+if (get_conf('TREE_TRANSFORMATIONS')) {
+  my @transformations = split /,/, get_conf('TREE_TRANSFORMATIONS');
+  foreach my $transformation (@transformations) {
+    if (Texinfo::Common::valid_tree_transformation($transformation)) {
+      $tree_transformations{$transformation} = 1;
+    } else {
+      document_warn (sprintf(__('Unknown tree transformation %s'), 
+                     $transformation));
+    }
+  }
+}
+
 if (get_conf('SPLIT') and !$formats_table{$format}->{'split'}) {
   document_warn (sprintf(__('Ignoring splitting for format %s'), $format));
   set_from_cmdline('SPLIT', ''); 
@@ -970,6 +983,20 @@
     print STDERR Data::Dumper->Dump([$tree]);
   }
 
+  if ($tree_transformations{'fill_gaps_in_sectioning'}) {
+    my $filled_contents = Texinfo::Structuring::fill_gaps_in_sectioning($tree);
+    if (!defined($filled_contents)) {
+      document_warn (__("fill_gaps_in_sectioning transformation return no 
result. No section?"));
+    } else {
+      $tree->{'contents'} = $filled_contents;
+    }
+  }
+  if ((get_conf('SIMPLE_MENU')
+       and $formats_table{$format}->{'simple_menu'})
+      or $tree_transformations{'simple_menus'}) {
+    $parser->Texinfo::Structuring::set_menus_to_simple_menu();
+  }
+
   if (defined(get_conf('MACRO_EXPAND'))) {
     my $texinfo_text = Texinfo::Convert::Texinfo::convert ($tree, 1);
     #print STDERR "$texinfo_text\n";
@@ -1017,10 +1044,6 @@
     Texinfo::Structuring::number_floats($floats);
   }
   $error_count = handle_errors($parser, $error_count, address@hidden);
-  if (get_conf('SIMPLE_MENU')
-      and $formats_table{$format}->{'simple_menu'}) {
-    $parser->Texinfo::Structuring::set_menus_to_simple_menu();
-  }
 
   if ($file_number != 0) {
     delete $cmdline_options->{'OUTFILE'} if 
exists($cmdline_options->{'OUTFILE'});

Index: tp/Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- tp/Texinfo/Common.pm        7 Feb 2012 00:40:47 -0000       1.127
+++ tp/Texinfo/Common.pm        7 Feb 2012 19:41:39 -0000       1.128
@@ -55,6 +55,7 @@
 normalize_top_node_name
 protect_comma_in_tree
 protect_first_parenthesis
+valid_tree_transformation
 ) ] );
 
 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@@ -180,6 +181,7 @@
   'SORT_ELEMENT_COUNT', 'SORT_ELEMENT_COUNT_WORDS',
   'KEEP_TOP_EXTERNAL_REF',
   'TEXI2HTML', 'IMAGE_LINK_PREFIX', 'FIX_TEXINFO',
+  'TREE_TRANSFORMATIONS',
 # FIXME document
   'TEXTCONTENT_COMMENT',
 # FIXME Not strings. To be documented.
@@ -220,6 +222,19 @@
   return $obsolete_options{$option};
 }
 
+my %valid_tree_transformations;
+foreach my $valid_transformation ('simple_menus', 'fill_gaps_in_sectioning') {
+  $valid_tree_transformations{$valid_transformation} = 1;
+}
+
+sub valid_tree_transformation ($)
+{
+  my $transformation = shift;
+  return 1 if (defined($transformation) 
+               and $valid_tree_transformations{$transformation});
+  return 0;
+}
+
 our %no_brace_commands;             # commands never taking braces
 %no_brace_commands = (
            '*', "\n",
@@ -1825,6 +1840,12 @@
 The C<$parser> argument is optional, it is used to continue 
 through C<@insertcopying> if in a C<@copying>.
 
+=item valid_tree_transformation($name)
+
+Return true if the I<$name> is a known tree transformation name
+that may be passed with C<TREE_TRANSFORMATIONS> to modify a texinfo
+tree.
+
 =back
 
 =head1 SEE ALSO



reply via email to

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