texi2html-cvs
[Top][All Lists]
Advanced

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

[Texi2html-cvs] texi2html ChangeLog NEWS T2h_l2h.pm TODO texi2h...


From: Patrice Dumas
Subject: [Texi2html-cvs] texi2html ChangeLog NEWS T2h_l2h.pm TODO texi2h...
Date: Thu, 21 May 2009 20:16:00 +0000

CVSROOT:        /cvsroot/texi2html
Module name:    texi2html
Changes by:     Patrice Dumas <pertusus>        09/05/21 20:16:00

Modified files:
        .              : ChangeLog NEWS T2h_l2h.pm TODO texi2html.init 
                         texi2html.pl 
        doc            : texi2html.texi 
        examples       : book.init chm.init enable_encoding.init 
                         noheaders.init tex4ht.init 
        test/contents  : do_contents.init 
        test/manuals   : mini_ker_t2h.init 

Log message:
                * texi2html.pl, texi2html.init, examples/*, T2h_l2h.pm:
                replace $DO_CONTENTS by $CONTENTS and $DO_SCONTENTS by
                $SHORTCONTENTS.
                Handle -o /dev/null (or NUL) like makeinfo.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texi2html/ChangeLog?cvsroot=texi2html&r1=1.384&r2=1.385
http://cvs.savannah.gnu.org/viewcvs/texi2html/NEWS?cvsroot=texi2html&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/texi2html/T2h_l2h.pm?cvsroot=texi2html&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texi2html/TODO?cvsroot=texi2html&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.init?cvsroot=texi2html&r1=1.195&r2=1.196
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.pl?cvsroot=texi2html&r1=1.285&r2=1.286
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/texi2html.texi?cvsroot=texi2html&r1=1.87&r2=1.88
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/book.init?cvsroot=texi2html&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/chm.init?cvsroot=texi2html&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/enable_encoding.init?cvsroot=texi2html&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/noheaders.init?cvsroot=texi2html&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/tex4ht.init?cvsroot=texi2html&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/contents/do_contents.init?cvsroot=texi2html&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/manuals/mini_ker_t2h.init?cvsroot=texi2html&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texi2html/texi2html/ChangeLog,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -b -r1.384 -r1.385
--- ChangeLog   20 May 2009 23:22:20 -0000      1.384
+++ ChangeLog   21 May 2009 20:15:54 -0000      1.385
@@ -1,3 +1,10 @@
+2009-05-21   Patrice Dumas  <address@hidden>
+
+       * texi2html.pl, texi2html.init, examples/*, T2h_l2h.pm:
+       replace $DO_CONTENTS by $CONTENTS and $DO_SCONTENTS by 
+       $SHORTCONTENTS.
+       Handle -o /dev/null (or NUL) like makeinfo.
+
 2009-05-20   Patrice Dumas  <address@hidden>
 
        * texi2html.pl, texi2html.init: Suffixes (in @INPUT_FILE_SUFFIXES) 

Index: NEWS
===================================================================
RCS file: /cvsroot/texi2html/texi2html/NEWS,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- NEWS        17 May 2009 15:35:15 -0000      1.97
+++ NEWS        21 May 2009 20:15:54 -0000      1.98
@@ -9,6 +9,8 @@
 
 * Handle @DH{}, @dh{}, @TH{}, @th{}. 
 
+* Handle -o /dev/null (or NUL) like makeinfo.
+
 * BUG FIXES
   ---------
 
@@ -20,7 +22,8 @@
   -------------
 
 * Information that can be set by @-commands should now be accessed
-  through get_conf.
+  through get_conf, and also some information about the document (the
+  information that can change for each manual being processed).
 
 * $format_list_item_texi should now modify directly the @item argument
   and apply the @-command given as @table argument. Correspondingly, 
@@ -38,6 +41,8 @@
 
 * replace $LANG by $DOCUMENTLANGUAGE.
 
+* replace $DO_CONTENTS by $CONTENTS and $DO_SCONTENTS by $SHORTCONTENTS.
+
 1.82 (2009-01-05)
 
 * NEW FEATURES

Index: T2h_l2h.pm
===================================================================
RCS file: /cvsroot/texi2html/texi2html/T2h_l2h.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- T2h_l2h.pm  1 Sep 2008 14:48:24 -0000       1.7
+++ T2h_l2h.pm  21 May 2009 20:15:55 -0000      1.8
@@ -132,6 +132,7 @@
 
    $html_output_count = 0;   # html text outputed in html result file
    $status = 0;
+   return if 
($Texi2HTML::Config::null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
 
     $docu_name = $Texi2HTML::THISDOC{'file_base_name'};
     $docu_rdir = $Texi2HTML::THISDOC{'destination_directory'};
@@ -172,6 +173,7 @@
     my $command = shift;
     my $text = shift;
     my $counter = shift;
+    return unless ($status);
     if ($command eq 'tex')
     {
         $text .= ' ';
@@ -434,6 +436,7 @@
     my $style = shift;
     my $counter = shift;
     my $state = shift;
+    return unless ($status);
     my $count = $global_count{"${style}_$counter"}; 
     ################################## begin debug section (incorrect counts)
     if (!defined($count))

Index: TODO
===================================================================
RCS file: /cvsroot/texi2html/texi2html/TODO,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- TODO        20 May 2009 23:22:20 -0000      1.98
+++ TODO        21 May 2009 20:15:55 -0000      1.99
@@ -378,6 +378,9 @@
  $Config{osname} $Config{osvers}
  dos djgpp
 
+  Also for -E and (unimplemented) links file, and also be careful with 
+  idx file.
+
 * warning if @direcategory/@direntry after first node or element.
 
 * warning if macro without argument is called without a {}.

Index: texi2html.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.init,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -b -r1.195 -r1.196
--- texi2html.init      20 May 2009 23:22:20 -0000      1.195
+++ texi2html.init      21 May 2009 20:15:55 -0000      1.196
@@ -12,7 +12,7 @@
 # Afterwards, load the file with command-line 
 # option -init-file <your_init_file>
 #
-# $Id: texi2html.init,v 1.195 2009/05/20 23:22:20 pertusus Exp $
+# $Id: texi2html.init,v 1.196 2009/05/21 20:15:55 pertusus Exp $
 
 ######################################################################
 # The following variables can also be set by command-line options
@@ -308,10 +308,10 @@
 @INPUT_FILE_SUFFIXES = ('.txi','.texinfo','.texi','.txinfo','');
 
 # If true do table of contents even if there is no @content
-$DO_CONTENTS = undef;
+$CONTENTS = undef;
 
 # If true do short table of contents even if there is no @shortcontent
-$DO_SCONTENTS = undef;
+$SHORTCONTENTS = undef;
 
 # if set, output the contents where the command is located
 $INLINE_CONTENTS = 0;
@@ -601,6 +601,19 @@
    'About' => 'SEC_About'
 );
 
+# determine the null devices
+my $default_null_device = File::Spec->devnull();
+%null_device_file = (
+ $default_null_device => 1
+);
+# special case, djgpp recognizes both null devices
+if ($Config{osname} eq 'dos' and $Config{osvers} eq 'djgpp')
+{
+  $null_device_file{'/dev/null'} = 1;
+  $null_device_file{'NUL'} = 1;
+}
+
+
 $init_out    = \&t2h_default_init_out;
 $finish_out    = \&t2h_default_finish_out;
 
@@ -846,7 +859,7 @@
     }
     if (!defined($EXTERNAL_CROSSREF_SPLIT))
     {
-        if ($SPLIT) 
+        if (get_conf('SPLIT')) 
         {
             $Texi2HTML::THISDOC{'EXTERNAL_CROSSREF_SPLIT'} = 1;
         }
@@ -1137,7 +1150,7 @@
     }
     else
     { # got to do this here, as it isn't done in print_head_navigation
-        return &$print_navigation($buttons) if ($SECTION_NAVIGATION or $SPLIT 
eq 'node');
+        return &$print_navigation($buttons) if ($SECTION_NAVIGATION or 
get_conf('SPLIT') eq 'node');
     }
 }
 
@@ -1150,8 +1163,7 @@
     my $buttons = address@hidden;
 
     my $nw = main::print_lines($fh);
-    if (defined $SPLIT
-        and (($SPLIT eq 'node') && $SECTION_NAVIGATION))
+    if ((get_conf('SPLIT') eq 'node') && $SECTION_NAVIGATION)
     {
         my $buttons = address@hidden;
         &$print_foot_navigation($fh, $buttons, $SMALL_RULE,
@@ -1194,7 +1206,7 @@
     my $element = shift;
     my $buttons = address@hidden;
     &$print_foot_navigation($fh, $buttons, $SMALL_RULE, 
-       ($end_page and ($SECTION_NAVIGATION or ($SPLIT and $SPLIT ne 'node'))), 
$element);
+       ($end_page and ($SECTION_NAVIGATION or (get_conf('SPLIT') and 
get_conf('SPLIT') ne 'node'))), $element);
 #    &$print_foot_navigation($fh);
 #    print $fh "$SMALL_RULE\n";
     if ($end_page)
@@ -1263,7 +1275,7 @@
 {
     # if there is no section navigation and it is not split, the 
     # navigation information is useless
-    return &$print_misc(@_) if ($SPLIT or $SECTION_NAVIGATION);
+    return &$print_misc(@_) if (get_conf('SPLIT') or $SECTION_NAVIGATION);
 }
 
 sub T2H_DEFAULT_print_misc_header
@@ -1283,11 +1295,10 @@
     my $buttons = shift;
     my $new_file = shift;
     &$print_foot_navigation($fh, $buttons, $SMALL_RULE, 
-        ($new_file and ($SECTION_NAVIGATION or ($SPLIT and $SPLIT ne 
'node'))), undef);
+        ($new_file and ($SECTION_NAVIGATION or (get_conf('SPLIT') and 
get_conf('SPLIT') ne 'node'))), undef);
 #    print $fh "$SMALL_RULE\n";
     if ($new_file)
     {
-#        &$print_navigation($fh, $buttons);# if ($SPLIT ne 'node');
         &$print_page_foot($fh);
     }
 }
@@ -1371,7 +1382,7 @@
 {
     my $fh = shift;
     my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_simple_format'}";
-    $longtitle .= ": $Texi2HTML::SIMPLE_TEXT{'This'}" if (defined 
($Texi2HTML::SIMPLE_TEXT{'This'}) and ($Texi2HTML::SIMPLE_TEXT{'This'} !~ 
/^\s*$/) and $SPLIT);
+    $longtitle .= ": $Texi2HTML::SIMPLE_TEXT{'This'}" if (defined 
($Texi2HTML::SIMPLE_TEXT{'This'}) and ($Texi2HTML::SIMPLE_TEXT{'This'} !~ 
/^\s*$/) and get_conf('SPLIT'));
     my $description = $Texi2HTML::THISDOC{'DOCUMENT_DESCRIPTION'};
     $description = $longtitle if (!defined($description));
     $description = "<meta name=\"description\" content=\"$description\">" if
@@ -1503,8 +1514,7 @@
 <td align="left">
 EOT
     }
-    elsif (defined $SPLIT
-           and ($SPLIT eq 'node'))
+    elsif (get_conf('SPLIT') eq 'node')
     {
         $result .= "$SMALL_RULE\n";
     }
@@ -1748,8 +1758,8 @@
 # $AFTER_OVERVIEW
 # $BEFORE_TOC_LINES
 # $AFTER_TOC_LINES
-# $DO_CONTENTS
-# $DO_SCONTENTS
+# $CONTENTS
+# $SHORTCONTENTS
 
 sub T2H_DEFAULT_toc_body($)
 {
@@ -3737,6 +3747,9 @@
 
 #print STDERR "enable_encoding_accent called($in) $accent (@$style_stack)\n";
 
+  # this should happen rarely, like during @setfilename parsing.
+  return &{$t2h_enable_encoding_default_accent{$in}->{$accent}}(@other_args) 
if (!defined($Texi2HTML::THISDOC{'ENCODING_NAME'}));
+
   return t2h_utf8_accent($accent,[$text],$style_stack) if 
($Texi2HTML::THISDOC{'ENCODING_NAME'} eq 'utf-8');
   return &{$t2h_enable_encoding_default_accent{$in}->{$accent}}(@other_args) 
if (!exists($makeinfo_encoding_to_map{$Texi2HTML::THISDOC{'ENCODING_NAME'}}));
   if (scalar(@t2h_enable_encoding_accents_stack)) 
@@ -5495,7 +5508,7 @@
              }
              elsif ($target_split and $target_mono)
              { # depends on the splitting of the manual
-                  $target_split = $SPLIT;
+                  $target_split = get_conf('SPLIT');
              }
              elsif ($target_mono)
              { # only mono specified
@@ -5512,7 +5525,7 @@
                   {
                        $file = "$EXTERNAL_DIR/$file";
                   }
-                  elsif ($SPLIT)
+                  elsif (get_conf('SPLIT'))
                   {
                        $file = "../$file";
                   }
@@ -5530,7 +5543,7 @@
                        {
                             $file = "$EXTERNAL_DIR/$file";
                        }
-                       elsif ($SPLIT)
+                       elsif (get_conf('SPLIT'))
                        {
                            $file = "../$file";
                        }
@@ -6214,7 +6227,7 @@
        }
        else
        {
-           $result .= &$print_head_navigation(undef, address@hidden) if 
($SPLIT or $SECTION_NAVIGATION);
+           $result .= &$print_head_navigation(undef, address@hidden) if 
(get_conf('SPLIT') or $SECTION_NAVIGATION);
        }
     }
 

Index: texi2html.pl
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.pl,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -b -r1.285 -r1.286
--- texi2html.pl        20 May 2009 23:22:21 -0000      1.285
+++ texi2html.pl        21 May 2009 20:15:56 -0000      1.286
@@ -45,10 +45,6 @@
 # to determine the path separator and null file
 use Config;
 
-my $path_separator = $Config{'path_sep'};
-$path_separator = ':' if (!defined($path_separator));
-my $quoted_path_separator = quotemeta($path_separator);
-
 #use encoding::warnings;
 # for translations
 #use encoding 'utf8';
@@ -62,6 +58,11 @@
 # Perl pragma to control optional warnings
 # use warnings;
 
+# determine the path separators
+my $path_separator = $Config{'path_sep'};
+$path_separator = ':' if (!defined($path_separator));
+my $quoted_path_separator = quotemeta($path_separator);
+
 #++##########################################################################
 #
 # NOTE FOR DEBUGGING THIS SCRIPT:
@@ -85,7 +86,7 @@
 }
 
 # CVS version:
-# $Id: texi2html.pl,v 1.285 2009/05/20 23:22:21 pertusus Exp $
+# $Id: texi2html.pl,v 1.286 2009/05/21 20:15:56 pertusus Exp $
 
 # Homepage:
 my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";;
@@ -196,6 +197,7 @@
 {
 package Texi2HTML::Config;
 
+use Config;
 
 sub load($) 
 {
@@ -256,8 +258,8 @@
 $NOVALIDATE
 $DEF_TABLE 
 $DOCUMENTLANGUAGE 
-$DO_CONTENTS
-$DO_SCONTENTS
+$CONTENTS
+$SHORTCONTENTS
 $FOOTNOTESTYLE
 $FILLCOLUMN
 $TOC_LINKS
@@ -579,6 +581,7 @@
 @command_handler_finish
 %command_handler
 %special_style
+%null_device_file
 );
 
 # subject to change
@@ -626,12 +629,16 @@
    'fillcolumn' => \$FILLCOLUMN,
    'documentlanguage' => \$DOCUMENTLANGUAGE,
    'novalidate' => \$NOVALIDATE,
+   'SPLIT' => \$SPLIT,
+   'SPLIT_SIZE' => \$SPLIT_SIZE,
+   'contents' => \$CONTENTS,
+   'shortcontents' => \$SHORTCONTENTS,
 );
 
 sub get_conf($)
 {
     my $name = shift;
-    return $Texi2HTML::GLOBAL{$name} if (defined($Texi2HTML::GLOBAL{$name}));
+#    return $Texi2HTML::GLOBAL{$name} if (defined($Texi2HTML::GLOBAL{$name}));
     return $Texi2HTML::THISDOC{$name} if (defined($Texi2HTML::THISDOC{$name}));
     return ${$config_map{$name}} if (defined($config_map{$name}));
     # there is no default value for many @-commmands, like kbdinputstyle,
@@ -658,8 +665,8 @@
 sub T2H_GPL_toc_body($)
 {
     my $elements_list = shift;
-    return unless ($Texi2HTML::THISDOC{'DO_CONTENTS'} or 
-      $Texi2HTML::THISDOC{'DO_SCONTENTS'} or $FRAMES);
+    return unless (Texi2HTML::Config::get_conf('contents') or 
+      Texi2HTML::Config::get_conf('shortcontents') or $FRAMES);
     my $current_level = 0;
     my $ul_style = $NUMBER_SECTIONS ? $NO_BULLET_LIST_ATTRIBUTE : ''; 
     foreach my $element (@$elements_list)
@@ -722,13 +729,13 @@
         my $ind = '  ' x $current_level;
         push(@{$Texi2HTML::TOC_LINES}, "</li>\n$ind</ul>\n");
     }
-    @{$Texi2HTML::TOC_LINES} = () unless ($Texi2HTML::THISDOC{'DO_CONTENTS'});
+    @{$Texi2HTML::TOC_LINES} = () unless 
(Texi2HTML::Config::get_conf('contents'));
     if (@{$Texi2HTML::TOC_LINES})
     {
         unshift @{$Texi2HTML::TOC_LINES}, $BEFORE_TOC_LINES;
         push @{$Texi2HTML::TOC_LINES}, $AFTER_TOC_LINES;
     }
-    @{$Texi2HTML::OVERVIEW} = () unless ($Texi2HTML::THISDOC{'DO_SCONTENTS'} 
or $FRAMES);
+    @{$Texi2HTML::OVERVIEW} = () unless 
(Texi2HTML::Config::get_conf('shortcontents') or $FRAMES);
     if (@{$Texi2HTML::OVERVIEW})
     {
         unshift @{$Texi2HTML::OVERVIEW}, "<ul${ul_style}>\n";
@@ -895,7 +902,7 @@
         #if ($SPLIT and $SPLIT_INDEX and $entries_count >= $SPLIT_INDEX)
         # FIXME this is not right, above is right
         # Don't split if document is not split
-        if ($SPLIT and $SPLIT_INDEX and $entries_count > $SPLIT_INDEX)
+        if (get_conf('SPLIT') and $SPLIT_INDEX and $entries_count > 
$SPLIT_INDEX)
         {
           push @{$t2h_default_index_letters_array{$index_name}}, [ @letters ];
           @letters = ();
@@ -915,7 +922,7 @@
 
   my ($file, $default_element_file);
 
-  if ($SPLIT)
+  if (get_conf('SPLIT'))
   {
     # respect the default splitting
     $default_element_file = $element->{'file'};
@@ -939,7 +946,7 @@
       $t2h_default_seen_files{$default_element_file} = $file;
     }
   }
-  my $modify_file = ($SPLIT and (!$use_node_file or 
$t2h_default_split_files{$default_element_file}));
+  my $modify_file = (get_conf('SPLIT') and (!$use_node_file or 
$t2h_default_split_files{$default_element_file}));
   $element->{'file'} = $file if ($modify_file);
 
   my $current_element = $element;
@@ -975,7 +982,7 @@
     }
     # the element is at the level of splitting, then we split according to
     # INDEX_SPLIT
-    elsif (!$element->{'top'} and $SPLIT and (($SPLIT eq 'node') or 
(defined($element->{'level'}) and $element->{'level'} <= 
$Texi2HTML::THISDOC{'split_level'})))
+    elsif (!$element->{'top'} and get_conf('SPLIT') and ((get_conf('SPLIT') eq 
'node') or (defined($element->{'level'}) and $element->{'level'} <= 
$Texi2HTML::THISDOC{'split_level'})))
     {
       $t2h_default_split_files{$default_element_file} = 1;
       foreach my $letters_split (@letters_split)
@@ -1271,8 +1278,8 @@
     main::do_element_directions($Texi2HTML::THIS_ELEMENT);
     main::open_out_file($current_page->{'element'}->{'file'});
     &$print_page_head($Texi2HTML::THISDOC{'FH'});
-    &$print_chapter_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'chapter';
-    &$print_section_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'section';
+    &$print_chapter_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if Texi2HTML::Config::get_conf('SPLIT') eq 'chapter';
+    &$print_section_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if Texi2HTML::Config::get_conf('SPLIT') eq 'section';
 
     @{$Texi2HTML::THIS_SECTION} =  
&$element_label($Texi2HTML::THIS_ELEMENT->{'id'}, $Texi2HTML::THIS_ELEMENT, 
undef, undef);
     push @{$Texi2HTML::THIS_SECTION}, &$print_element_header(1, 0);
@@ -3462,19 +3469,6 @@
    Texi2HTML::Config::t2h_enable_encoding_load();
 }
 
-if (defined($Texi2HTML::Config::DO_CONTENTS))
-{
-   $Texi2HTML::GLOBAL{'DO_CONTENTS'} = $Texi2HTML::Config::DO_CONTENTS;
-}
-if (defined($Texi2HTML::Config::DO_SCONTENTS))
-{
-   $Texi2HTML::GLOBAL{'DO_SCONTENTS'} = $Texi2HTML::Config::DO_SCONTENTS;
-}
-if (defined($Texi2HTML::Config::SPLIT_SIZE))
-{
-   $Texi2HTML::GLOBAL{'SPLIT_SIZE'} = $Texi2HTML::Config::SPLIT_SIZE;
-}
-
 # FIXME encoding for first file or all files?
 if (defined($Texi2HTML::Config::IN_ENCODING))
 {
@@ -3626,6 +3620,18 @@
     $Texi2HTML::Config::OUT = '';
 }
 
+# FIXME
+# if the global configuration variable is set, this overrides what 
+# could be set in the manual. This may be wrong for 'contents' and 
+# 'shortcontents' since it is inconsistent with how @-commands in
+# documents override variables in config files. It is only relevant
+# if the variables are set to 0, however, since the @-command is a 
+# no-op if already set to 1.
+foreach my $global_conf_vars('contents','shortcontents','SPLIT', 'SPLIT_SIZE')
+{
+    
Texi2HTML::Config::set_conf($global_conf_vars,Texi2HTML::Config::get_conf($global_conf_vars),1);
+}
+
 @Texi2HTML::Config::INCLUDE_DIRS = 
split(/$quoted_path_separator/,join($path_separator,@Texi2HTML::Config::INCLUDE_DIRS));
 @Texi2HTML::Config::PREPEND_DIRS = 
split(/$quoted_path_separator/,join($path_separator,@Texi2HTML::Config::PREPEND_DIRS));
 
@@ -3697,8 +3703,17 @@
 
 # subdir
    $docu_rdir = '';
-
-   if ($Texi2HTML::Config::SPLIT)
+   my $null_output;
+   if (defined($Texi2HTML::Config::OUT) and ($file_nr == 0) and 
$Texi2HTML::Config::null_device_file{$Texi2HTML::Config::OUT})
+   { # this overrides the GLOBAL setting for this file. set_conf
+      $Texi2HTML::THISDOC{'SPLIT'} = '';
+      $Texi2HTML::THISDOC{'SPLIT_SIZE'} = undef;
+      $null_output = 1;
+      $path_to_working_dir = $docu_rdir;
+   }
+   if (!$null_output)
+   {
+      if (Texi2HTML::Config::get_conf('SPLIT'))
    {
       if (defined($Texi2HTML::Config::OUT) and ($file_nr == 0))
       {
@@ -3812,6 +3827,7 @@
       $path_to_working_dir =~ s:/*$::;
       $path_to_working_dir .= '/' unless($path_to_working_dir eq '');
    }
+   }
 
    my $docu_ext = $Texi2HTML::THISDOC{'extension'};
    # out_dir is undocummented, should never be used, use destination_directory
@@ -3821,7 +3837,7 @@
    $Texi2HTML::THISDOC{'file_base_name'} = $docu_name;
 
    $docu_doc = $docu_name . (defined($docu_ext) ? ".$docu_ext" : ""); # 
document's contents
-   if ($Texi2HTML::Config::SPLIT)
+   if (Texi2HTML::Config::get_conf('SPLIT'))
    {
 # AAAA
       if (defined($Texi2HTML::Config::TOP_FILE) and 
($Texi2HTML::Config::TOP_FILE ne '') and ($file_nr == 0))
@@ -3839,8 +3855,12 @@
       if (defined($Texi2HTML::Config::OUT) and ($file_nr == 0))
       {
          my $out_file = $Texi2HTML::Config::OUT;
-         $Texi2HTML::THISDOC{'SPLIT_SIZE'} = undef if ($out_file eq '-');
-         $out_file =~ s|.*/||;
+         if ($out_file eq '-')
+         {
+            $Texi2HTML::THISDOC{'SPLIT'} = '';
+            $Texi2HTML::THISDOC{'SPLIT_SIZE'} = undef;
+         }
+         $out_file =~ s|.*/|| unless ($null_output);
          $docu_doc = $out_file if ($out_file !~ /^\s*$/);
       }
       if (defined $Texi2HTML::Config::element_file_name)
@@ -3852,7 +3872,7 @@
       $docu_top = $docu_doc;
    }
 
-   if ($Texi2HTML::Config::SPLIT or !$Texi2HTML::Config::MONOLITHIC)
+   if (Texi2HTML::Config::get_conf('SPLIT') or !$Texi2HTML::Config::MONOLITHIC)
    {
       if (defined $Texi2HTML::Config::element_file_name)
       {
@@ -4877,17 +4897,11 @@
     }
     elsif (($macro eq 'contents') or ($macro eq 'summarycontents') or ($macro 
eq 'shortcontents'))
     {
-        if ($macro eq 'contents')
-        {
-            $Texi2HTML::THISDOC{'DO_CONTENTS'} = 1 unless 
(defined($Texi2HTML::Config::DO_CONTENTS));
-            $Texi2HTML::THISDOC{$macro} = 1; 
-        }
-        else
+        if ($macro ne 'contents')
         {
             $macro = 'shortcontents';
-            $Texi2HTML::THISDOC{'DO_SCONTENTS'} = 1 unless 
(defined($Texi2HTML::Config::DO_SCONTENTS));
-            $Texi2HTML::THISDOC{$macro} = 1; 
         }
+        Texi2HTML::Config::set_conf($macro, 1);
         push @{$state->{'place'}}, $content_element{$macro};
     }
     elsif ($macro eq 'dircategory' and ($line =~ /^\s+(.*)\s*$/))
@@ -6531,21 +6545,21 @@
     # find document nr and document file for sections and nodes. 
     # Split according to Texi2HTML::Config::SPLIT.
     # find file and id for placed elements (anchors, index entries, headings)
-    if ($Texi2HTML::Config::SPLIT)
+    if (Texi2HTML::Config::get_conf('SPLIT'))
     {
         $Texi2HTML::THISDOC{'split_level'} = $toplevel;
         my $doc_nr = -1;
-        if ($Texi2HTML::Config::SPLIT eq 'section')
+        if (Texi2HTML::Config::get_conf('SPLIT') eq 'section')
         {
             $Texi2HTML::THISDOC{'split_level'} = 2 if ($toplevel <= 2);
         }
         my $previous_file;
         foreach my $element (@elements_list)
         { 
-            print STDERR "# Splitting 
($Texi2HTML::Config::SPLIT:$Texi2HTML::THISDOC{'split_level'}) 
$element->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS);
+            print STDERR "# Splitting 
(".Texi2HTML::Config::get_conf('SPLIT').":$Texi2HTML::THISDOC{'split_level'}) 
$element->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS);
             my $new_file = 0;
             if (
-               ($Texi2HTML::Config::SPLIT eq 'node') or
+               (Texi2HTML::Config::get_conf('SPLIT') eq 'node') or
                (
                  defined($element->{'level'}) and ($element->{'level'} <= 
$Texi2HTML::THISDOC{'split_level'})
                )
@@ -6628,9 +6642,9 @@
     # if setcontentsaftertitlepage is set, the contents should be associated
     # with the titlepage. That's wat is done there.
     push @$no_element_associated_place, $content_element{'contents'} 
-      if ($Texi2HTML::THISDOC{'DO_CONTENTS'} and 
$Texi2HTML::THISDOC{'setcontentsaftertitlepage'});
+      if (Texi2HTML::Config::get_conf('contents') and 
$Texi2HTML::THISDOC{'setcontentsaftertitlepage'});
     push @$no_element_associated_place, $content_element{'shortcontents'} 
-      if ($Texi2HTML::THISDOC{'DO_SCONTENTS'} and 
$Texi2HTML::THISDOC{'setshortcontentsaftertitlepage'});
+      if (Texi2HTML::Config::get_conf('shortcontents') and 
$Texi2HTML::THISDOC{'setshortcontentsaftertitlepage'});
     # correct the id and file for the things placed in regions (copying...)
     foreach my $place(@$no_element_associated_place)
     {
@@ -7349,7 +7363,7 @@
         }
     }
 
-    $Texi2HTML::THISDOC{'do_about'} = 1 unless 
(defined($Texi2HTML::THISDOC{'do_about'}) or $one_section or (not 
$Texi2HTML::Config::SPLIT and not $Texi2HTML::Config::SECTION_NAVIGATION));
+    $Texi2HTML::THISDOC{'do_about'} = 1 unless 
(defined($Texi2HTML::THISDOC{'do_about'}) or $one_section or (not 
Texi2HTML::Config::get_conf('SPLIT') and not 
$Texi2HTML::Config::SECTION_NAVIGATION));
     
     $Texi2HTML::NAME{'First'} = $element_first->{'text'};
     $Texi2HTML::NAME{'Last'} = $element_last->{'text'};
@@ -7538,8 +7552,8 @@
                         else
                         {
                              
&$Texi2HTML::Config::print_page_head($Texi2HTML::THISDOC{'FH'}) if 
($do_page_head);
-                             
&$Texi2HTML::Config::print_chapter_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'chapter';
-                             
&$Texi2HTML::Config::print_section_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'section';
+                             
&$Texi2HTML::Config::print_chapter_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if Texi2HTML::Config::get_conf('SPLIT') eq 'chapter';
+                             
&$Texi2HTML::Config::print_section_header($Texi2HTML::THISDOC{'FH'}, 
$Texi2HTML::THIS_ELEMENT) if Texi2HTML::Config::get_conf('SPLIT') eq 'section';
                         }
                         $first_section = 1;
                     }
@@ -7744,7 +7758,7 @@
         }
     }
         
-    unless ($Texi2HTML::Config::SPLIT)
+    unless (Texi2HTML::Config::get_conf('SPLIT'))
     {
         &$Texi2HTML::Config::print_page_foot($Texi2HTML::THISDOC{'FH'});
         # this leaves the possibility for external code to close the file
@@ -7764,7 +7778,7 @@
 #print STDERR "FINISH_ELEMENT($FH)($element->{'texi'})[$element->{'file'}] 
counter $files{$element->{'file'}}->{'counter'}\n";
 
     # handle foot notes
-    if ($Texi2HTML::Config::SPLIT and scalar(@foot_lines) 
+    if (Texi2HTML::Config::get_conf('SPLIT') and scalar(@foot_lines) 
         and (Texi2HTML::Config::get_conf('footnotestyle') eq 'end')
         and  (! $new_element or
         ($element and ($new_element->{'file'} ne $element->{'file'})))
@@ -7800,7 +7814,7 @@
         $Texi2HTML::HREF{'Top'} = href($element_top, $element->{'file'});
         &$Texi2HTML::Config::print_Top($FH, $element->{'titlefont'}, $element);
         my $end_page = 0;
-        if ($Texi2HTML::Config::SPLIT)
+        if (Texi2HTML::Config::get_conf('SPLIT'))
         {
             if (!$files{$element->{'file'}}->{'counter'})
             {
@@ -7827,8 +7841,8 @@
                  if ($T2H_DEBUG & $DEBUG_ELEMENTS);
              if (!$files{$element->{'file'}}->{'counter'})
              {
-                 &$Texi2HTML::Config::print_chapter_footer($FH, $element) if 
($Texi2HTML::Config::SPLIT eq 'chapter');
-                 &$Texi2HTML::Config::print_section_footer($FH, $element) if 
($Texi2HTML::Config::SPLIT eq 'section');
+                 &$Texi2HTML::Config::print_chapter_footer($FH, $element) if 
(Texi2HTML::Config::get_conf('SPLIT') eq 'chapter');
+                 &$Texi2HTML::Config::print_section_footer($FH, $element) if 
(Texi2HTML::Config::get_conf('SPLIT') eq 'section');
                  print STDERR "# Close file after $element->{'texi'}\n" 
                      if ($T2H_DEBUG & $DEBUG_ELEMENTS);
                  &$Texi2HTML::Config::print_page_foot($FH);
@@ -7844,10 +7858,10 @@
         {
             print STDERR "# End of last section\n"
                  if ($T2H_DEBUG & $DEBUG_ELEMENTS);
-            if ($Texi2HTML::Config::SPLIT)
+            if (Texi2HTML::Config::get_conf('SPLIT'))
             { # end of last splitted section
-                &$Texi2HTML::Config::print_chapter_footer($FH, $element) if 
($Texi2HTML::Config::SPLIT eq 'chapter');
-                &$Texi2HTML::Config::print_section_footer($FH, $element) if 
($Texi2HTML::Config::SPLIT eq 'section');
+                &$Texi2HTML::Config::print_chapter_footer($FH, $element) if 
(Texi2HTML::Config::get_conf('SPLIT') eq 'chapter');
+                &$Texi2HTML::Config::print_section_footer($FH, $element) if 
(Texi2HTML::Config::get_conf('SPLIT') eq 'section');
                 &$Texi2HTML::Config::print_page_foot($FH);
                 close_out($FH);
             }
@@ -7879,7 +7893,7 @@
         my $node = $nodes{$key};
         next unless ($node->{'node_file'});
         my $redirection_file = $docu_doc;
-        $redirection_file = $node->{'file'} if ($Texi2HTML::Config::SPLIT);
+        $redirection_file = $node->{'file'} if 
(Texi2HTML::Config::get_conf('SPLIT'));
         if (!$redirection_file)
         {
              print STDERR "Bug: file for redirection for `$node->{'texi'}' 
don't exist\n" unless (Texi2HTML::Config::get_conf('novalidate') or 
!$node->{'seen'});
@@ -9919,7 +9933,7 @@
                 # if Texi2HTML::Config::SPLIT the file is '' which ensures 
                 # a href with the file name. if ! Texi2HTML::Config::SPLIT 
                 # the 2 file will be the same thus there won't be the file name
-                $file = $element->{'file'} unless ($Texi2HTML::Config::SPLIT);
+                $file = $element->{'file'} unless 
(Texi2HTML::Config::get_conf('SPLIT'));
             }
            #print STDERR "SUBHREF in ref to node `$node_texi'";
             my $href = href($element, $file, $line_nr);
@@ -14239,7 +14253,7 @@
     for my $line (@$lines)
     {
         print $fh $line;
-       if (defined($Texi2HTML::Config::WORDS_IN_PAGE) and 
($Texi2HTML::Config::SPLIT eq 'node'))
+       if (defined($Texi2HTML::Config::WORDS_IN_PAGE) and 
(Texi2HTML::Config::get_conf('SPLIT') eq 'node'))
         {
             @cnt = split(/\W*\s+\W*/, $line);
             $cnt += scalar(@cnt);

Index: doc/texi2html.texi
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/texi2html.texi,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- doc/texi2html.texi  17 May 2009 15:35:16 -0000      1.87
+++ doc/texi2html.texi  21 May 2009 20:15:57 -0000      1.88
@@ -1471,6 +1471,7 @@
 strings, flags set by @code{@@set} and special flags and section lines.
 
 @subsubheading Strings that can be set by some @@-commands
address@hidden get_conf
 
 Some information may be set up by @@-commands, by
 a variable in the init file, and sometime on the command-line. 
@@ -1584,6 +1585,10 @@
 @item css_lines
 reference on an array containing the normal lines of 
 @acronym{CSS} files.
address@hidden SPLIT
+How the manual is split.
address@hidden SPLIT_SIZE
+The split size, only relevant for info output.
 @end table
 
 @subsubheading Flags
@@ -4559,6 +4564,7 @@
 @item $SEPARATED_FOOTNOTES has been replaced by $FOOTNOTESTYLE, that takes the 
   same argument than @@footnotestyle.
 @item replace $LANG by $DOCUMENTLANGUAGE.
address@hidden replace $DO_CONTENTS by $CONTENTS and $DO_SCONTENTS by 
$SHORTCONTENTS.
 @item @@verbatiminclude is now a $raw command argument distinct from 
@@verbatim.
 @item @@direntry is formatted like a menu and passed down to $menu_command.
 @end itemize

Index: examples/book.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/book.init,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- examples/book.init  24 Sep 2008 23:39:19 -0000      1.15
+++ examples/book.init  21 May 2009 20:15:57 -0000      1.16
@@ -1,6 +1,6 @@
 # This is based on the scriptbasic style
 
-$DO_CONTENTS = 1;
+$CONTENTS = 1;
 
 $INLINE_CONTENTS = 1;
 
@@ -89,7 +89,6 @@
 
     if ($first_in_page and $SECTION_NAVIGATION)
     {
-        #print_up_toc($fh, $Texi2HTML::THIS_ELEMENT) if ($SPLIT eq 'node');
         $result = book_print_up_toc($Texi2HTML::THIS_ELEMENT);
         $result .= &$print_head_navigation(undef, $buttons);
     }
@@ -107,7 +106,6 @@
 
     my $buttons = address@hidden;
     # head navigation is printed with heading, and is in THIS_SECTION
-#    &$print_head_navigation($fh, $buttons) if ($SPLIT or $SECTION_NAVIGATION);
     my ($titlepage_text, $titlepage_no_texi, $titlepage_simple_text) = 
main::do_special_region_lines('titlepage',$Texi2HTML::THISDOC{'state'});
     &$titlepage([],$titlepage_text, $titlepage_no_texi, 
$titlepage_simple_text); 
     print $fh $Texi2HTML::TITLEPAGE;
@@ -124,7 +122,7 @@
 sub book_print_Toc
 {
     my $fh = shift;
-    &$print_page_head($fh) if $SPLIT;
+    &$print_page_head($fh) if (get_conf('SPLIT'));
     #print $fh $Texi2HTML::TITLEPAGE;
     print $fh '<h2> ' . $Texi2HTML::NAME{'Contents'} . "</h2>\n" ;
     main::print_lines($fh);
@@ -148,7 +146,7 @@
     my $type = shift;
     my $prefix = shift;
 
-    return undef if ($NODE_FILES or !$SPLIT);
+    return undef if ($NODE_FILES or !get_conf('SPLIT'));
     return undef if (!defined($element));
    
     if (defined($previous_nr) and ($element->{'doc_nr'} == $previous_nr))
@@ -207,7 +205,6 @@
          $text = &$anchor ('', 
"$Texi2HTML::THISDOC{'toc_file'}#$element->{'tocid'}", $text);
     }
     $text = "<h$level class=\"$class\"> $text </h$level>\n";
-    #if (defined($SPLIT)  and ($SPLIT eq 'node') 
     if (exists($element->{'child'}) 
         and ($element->{'tag_level'} !~ /heading/))
     {

Index: examples/chm.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/chm.init,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- examples/chm.init   17 May 2009 15:35:16 -0000      1.17
+++ examples/chm.init   21 May 2009 20:15:58 -0000      1.18
@@ -28,7 +28,7 @@
 #$SECTION_NAVIGATION = 0; # to avoid headers in normal elements
 $SHOW_MENU = 0;
 $SPLIT = 'node';
-$DO_CONTENTS = 1;
+$CONTENTS = 1;
 $SPLIT_INDEX = undef;
 $IDX_SUMMARY = 1;
 
@@ -234,7 +234,7 @@
 # Setting out file encoding to utf8 doesn't work. Seen on the web that 
 # htmlhelp 1.x isn't utf8 aware
 #   $Texi2HTML::THISDOC{'OUT_ENCODING'} = 'utf8';
-
+    return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
     my $hhk_file = 
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}"
 . ".hhk";
     open (IDXFILE, ">$hhk_file") or
         die "Can't open $hhk_file for writing: $!\n";
@@ -400,6 +400,7 @@
 
 sub chm_finish_out()
 {
+    return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
     print IDXFILE "</BODY>\n</HTML>\n";
     close (IDXFILE);
     my $hhc_file = 
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}.hhc";

Index: examples/enable_encoding.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/enable_encoding.init,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- examples/enable_encoding.init       20 May 2009 23:22:21 -0000      1.6
+++ examples/enable_encoding.init       21 May 2009 20:15:58 -0000      1.7
@@ -1,7 +1,11 @@
 # -*-perl-*-
 
#+##############################################################################
 #
-# enable_encoding.init: handle --enable-encoding
+# enable_encoding.init: mimics --enable-encoding
+# This is now directly handled in the main program. It is, however different
+# from the main program implementation snce this init file is much more
+# intrusive (for example it wouldn't work with info, but it would work 
+# better for a simple output format when entities are not used)
 #
 #    Copyright (C) 2008  Patrice Dumas <address@hidden>
 #

Index: examples/noheaders.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/noheaders.init,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- examples/noheaders.init     25 Apr 2009 14:54:43 -0000      1.14
+++ examples/noheaders.init     21 May 2009 20:15:58 -0000      1.15
@@ -22,8 +22,6 @@
 #
 
#-##############################################################################
 
-#$SPLIT = 'none';
-
 $print_section            = \&T2H_NOHEAD_print_section;
 #$print_element_header            = \&T2H_NOHEAD_print_element_header;
 $print_element_header            = \&T2H_NOHEAD_noop;
@@ -89,13 +87,13 @@
 sub T2H_NOHEAD_print_misc_header
 {
     my $fh = shift;
-    &$print_page_head($fh) if $SPLIT;
+    &$print_page_head($fh) if (get_conf('SPLIT'));
 }
 sub T2H_NOHEAD_print_misc_footer
 {
     my $fh = shift;
     print $fh "$SMALL_RULE\n";
-    if ($SPLIT)
+    if (get_conf('SPLIT'))
     {
         &$print_page_foot($fh);
     }

Index: examples/tex4ht.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/tex4ht.init,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- examples/tex4ht.init        8 Nov 2008 20:02:51 -0000       1.8
+++ examples/tex4ht.init        21 May 2009 20:15:58 -0000      1.9
@@ -76,6 +76,12 @@
 {
   # set file names
   $tex4ht_initial_dir = Cwd::abs_path;
+  if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}})
+  {
+    # when output is a null device we skip entirely the tex4ht stuff.
+    $tex4ht_latex_failed = 1;
+    return;
+  }
   $tex4ht_out_dir = "$Texi2HTML::THISDOC{'destination_directory'}";
   $tex4ht_out_dir = './' if (!defined($tex4ht_out_dir) or $tex4ht_out_dir =~ 
/^\s*$/);
   my $tex4ht_basename = "$Texi2HTML::THISDOC{'file_base_name'}_tex4ht";
@@ -200,9 +206,10 @@
 {
 #print STDERR "$style $tex4ht_latex_failed $tex4ht_counter\n";
   my $command = shift;
+  return if ($tex4ht_latex_failed);
+
   my $style = $commands{$command}->{'style'};
   my $fh = $commands{$command}->{'handle'};
-  return if ($tex4ht_latex_failed);
   # finish the tex file
   if ($style eq 'latex')
   {

Index: test/contents/do_contents.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/contents/do_contents.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- test/contents/do_contents.init      18 Aug 2008 18:01:51 -0000      1.1
+++ test/contents/do_contents.init      21 May 2009 20:15:59 -0000      1.2
@@ -1 +1 @@
-$DO_CONTENTS = 1;
+$CONTENTS = 1;

Index: test/manuals/mini_ker_t2h.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/manuals/mini_ker_t2h.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- test/manuals/mini_ker_t2h.init      18 Aug 2008 18:04:40 -0000      1.1
+++ test/manuals/mini_ker_t2h.init      21 May 2009 20:15:59 -0000      1.2
@@ -1,4 +1,4 @@
-$DO_SCONTENTS = 1;
+$SHORTCONTENTS = 1;
 
 $print_Top                   = \&mini_ker_print_Top;
 




reply via email to

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