Karl Berry <[EMAIL PROTECTED]> writes:

>     command-line option to control the size of split info
>     files.  
> 
> Thanks for the suggestion, I'll implement it when I have a chance if no
> one else gets to it first :).

How about this simple patch against Texinfo 4.0?

1999-12-09  Yoshiki Hayashi  <[EMAIL PROTECTED]>

        * makeinfo/makeinfo.h (split_size): New option.
        * makeinfo/makeinfo.c (long_options): Add split_size.
        (usage): Ditto. Suggested by Richard Y. Kim.

diff -cr texinfo-4.0.orig/makeinfo/makeinfo.c texinfo-4.0/makeinfo/makeinfo.c
*** texinfo-4.0.orig/makeinfo/makeinfo.c        Mon Sep 20 00:24:44 1999
--- texinfo-4.0/makeinfo/makeinfo.c     Thu Dec  9 16:31:05 1999
***************
*** 405,415 ****
                               if VAL is `none', do not indent;\n\
                               if VAL is `asis', preserve existing indentation.\n\
   --reference-limit=NUM     warn about at most NUM references (default %d).\n\
   -U VAR                    undefine a variable, as with @clear.\n\
   -v, --verbose             explain what is being done.\n\
   --version                 display version information and exit.\n\
  "),
!             paragraph_start_indent, reference_warning_limit);
    }
  
    puts (_("\n\
--- 405,417 ----
                               if VAL is `none', do not indent;\n\
                               if VAL is `asis', preserve existing indentation.\n\
   --reference-limit=NUM     warn about at most NUM references (default %d).\n\
+  --split-size=NUM          split into files at NUM size. (default %d).\n\
   -U VAR                    undefine a variable, as with @clear.\n\
   -v, --verbose             explain what is being done.\n\
   --version                 display version information and exit.\n\
  "),
!             paragraph_start_indent, reference_warning_limit,
!  DEFAULT_SPLIT_SIZE);
    }
  
    puts (_("\n\
***************
*** 457,462 ****
--- 459,465 ----
    { "output", 1, 0, 'o' },
    { "paragraph-indent", 1, 0, 'p' },
    { "reference-limit", 1, 0, 'r' },
+   { "split-size", 1, 0, 'S'},
    { "verbose", 0, &verbose_mode, 1 },
    { "version", 0, 0, 'V' },
    {NULL, 0, NULL, 0}
***************
*** 628,633 ****
--- 631,645 ----
            splitting = 0; /* too complicated for now */
            break;
  
+       case 'S': /* --split-size */
+           if (sscanf (optarg, "%d", &split_size) != 1)
+             {
+               fprintf (stderr,
+                      _("%s: %s arg must be numeric, not `%s'.\n"),
+                      "--split-size", progname, optarg);
+               usage (1);
+             }
+         break;
          case '?':
            usage (1);
            break;
***************
*** 1410,1416 ****
        toc_update ();
  
        if (splitting && !html && (!errors_printed || force))
!         split_file (real_output_filename, 0);
        else if (errors_printed
                 && !force
                 && strcmp (real_output_filename, "-") != 0
--- 1422,1428 ----
        toc_update ();
  
        if (splitting && !html && (!errors_printed || force))
!         split_file (real_output_filename, split_size);
        else if (errors_printed
                 && !force
                 && strcmp (real_output_filename, "-") != 0
diff -cr texinfo-4.0.orig/makeinfo/makeinfo.h texinfo-4.0/makeinfo/makeinfo.h
*** texinfo-4.0.orig/makeinfo/makeinfo.h        Sun Sep 19 03:09:22 1999
--- texinfo-4.0/makeinfo/makeinfo.h     Thu Dec  9 16:04:25 1999
***************
*** 181,186 ****
--- 181,189 ----
  /* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) 
*/
  DECLARE (int, number_sections, 0);
  
+ /* Nonzero means split size.  When zero, DEFAULT_SPLIT_SIZE is used. */
+ DECLARE (int, split_size, 0);
+ 
  /* Nonzero means expand node names and references while validating.
     This will avoid errors when the Texinfo document uses features
     like @@ and @value inconsistently in node names, but will slow


-- 
Yoshiki Hayashi

Reply via email to