changeset 98359:d4ebb53e6be1

* informat.el (Info-split-threshold): New variable. (Info-split): Use it. * textmodes/texinfmt.el (texinfo-format-buffer): Use Info-split-threshold to decide whether to split Info files.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Thu, 25 Sep 2008 23:09:28 +0000
parents 393e8f885464
children 03747d977258
files lisp/ChangeLog lisp/informat.el lisp/textmodes/texinfmt.el
diffstat 3 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Sep 25 22:10:31 2008 +0000
+++ b/lisp/ChangeLog	Thu Sep 25 23:09:28 2008 +0000
@@ -1,3 +1,11 @@
+2008-09-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* informat.el (Info-split-threshold): New variable.
+	(Info-split): Use it.
+
+	* textmodes/texinfmt.el (texinfo-format-buffer):
+	Use Info-split-threshold to decide whether to split Info files.
+
 2008-09-25  Chong Yidong  <cyd@stupidchicken.com>
 
 	* progmodes/octave-mod.el (octave-mode-menu): Fix incorrect
--- a/lisp/informat.el	Thu Sep 25 22:10:31 2008 +0000
+++ b/lisp/informat.el	Thu Sep 25 23:09:28 2008 +0000
@@ -153,9 +153,17 @@
 
 
 ;;;###autoload
+(defcustom Info-split-threshold 262144
+  "The number of characters by which `Info-split' splits an info file."
+  :type 'integer
+  :version "23.1"
+  :group 'texinfo)
+
+;;;###autoload
 (defun Info-split ()
   "Split an info file into an indirect file plus bounded-size subfiles.
-Each subfile will be up to 50,000 characters plus one node.
+Each subfile will be up to the number of characters that
+`Info-split-threshold' specifies, plus one node.
 
 To use this command, first visit a large Info file that has a tag
 table.  The buffer is modified into a (small) indirect info file which
@@ -167,7 +175,7 @@
 contains just the tag table and a directory of subfiles."
 
   (interactive)
-  (if (< (buffer-size) 70000)
+  (if (< (buffer-size) (+ 20000 Info-split-threshold))
       (error "This is too small to be worth splitting"))
   (goto-char (point-min))
   (search-forward "\^_")
@@ -192,7 +200,7 @@
       (narrow-to-region (point-min) (point))
       (goto-char (point-min))
       (while (< (1+ (point)) (point-max))
-	(goto-char (min (+ (point) 50000) (point-max)))
+	(goto-char (min (+ (point) Info-split-threshold) (point-max)))
 	(search-forward "\^_" nil 'move)
 	(setq subfiles
 	      (cons (list (+ start chars-deleted)
--- a/lisp/textmodes/texinfmt.el	Thu Sep 25 22:10:31 2008 +0000
+++ b/lisp/textmodes/texinfmt.el	Thu Sep 25 23:09:28 2008 +0000
@@ -166,7 +166,7 @@
     (Info-tagify)
     (if nosplit
         nil
-      (if (> (buffer-size) 100000)
+      (if (> (buffer-size) (+ 50000 Info-split-threshold))
           (progn
             (message (setq lastmessage "Splitting Info file..."))
             (Info-split))))