* informat.el: `Info-split' split size (was: registry doc patch)
[not found] ` <b4md4iunzue.fsf@jpl.org>
@ 2008-09-24 16:44 ` Reiner Steib
2008-09-24 23:58 ` informat.el: `Info-split' split size Katsumi Yamaoka
0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2008-09-24 16:44 UTC (permalink / raw)
To: emacs-devel, Katsumi Yamaoka; +Cc: ding
On Wed, Sep 24 2008, Katsumi Yamaoka wrote:
> BTW, with MAKEINFO=no the Gnus Info files are divided into 24
> files (gnus, gnus-1, ..., gnus-23). Those are too small, aren't
> they? The threshold is hard-coded in `Info-split' (informat.el).
,----[ <f1> f Info-split RET ]
| Info-split is an interactive autoloaded Lisp function in `informat'.
| (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. [...]
`----
I think the threshold should not be hard-coded and it's default should
be like makeinfo's so that we don't need such workarounds:
> A workaround I added to the Japanese edition of the Gnus Info is:
>
> ;; Reduce the number of split Info files.
> (if (featurep 'xemacs)
> (if (load "informat.el" t t)
> (let* ((fn (symbol-function 'Info-split))
> (fns (prin1-to-string fn)))
> (load "informat.elc" t t)
> (when (and (string-match "\\([\t\n ]+\\)50000\\([\t\n )]+\\)" fns)
> (condition-case nil
> (setq fn (byte-compile
> (read (replace-match "\\1200000\\2" nil nil
> fns))))
> (error nil))
> (fset 'Info-split fn)))))
> (require 'informat)
> (let* ((fn (symbol-function 'Info-split))
> (fns (prin1-to-string fn)))
> (when (string-match "\\([\t\n ]+\\)50000\\([\t\n ]+\\)" fns)
> (condition-case nil
> (fset 'Info-split (read (replace-match "\\1200000\\2" nil nil fns)))
> (error
> (fset 'Info-split fn))))))
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: informat.el: `Info-split' split size
2008-09-24 16:44 ` informat.el: `Info-split' split size (was: registry doc patch) Reiner Steib
@ 2008-09-24 23:58 ` Katsumi Yamaoka
2008-09-25 3:10 ` Eli Zaretskii
2008-09-25 23:10 ` Katsumi Yamaoka
0 siblings, 2 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2008-09-24 23:58 UTC (permalink / raw)
To: emacs-devel; +Cc: ding
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
>>>>> Reiner Steib wrote:
> On Wed, Sep 24 2008, Katsumi Yamaoka wrote:
>> BTW, with MAKEINFO=no the Gnus Info files are divided into 24
>> files (gnus, gnus-1, ..., gnus-23). Those are too small, aren't
>> they? The threshold is hard-coded in `Info-split' (informat.el).
> ,----[ <f1> f Info-split RET ]
>| Info-split is an interactive autoloaded Lisp function in `informat'.
>| (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. [...]
> `----
> I think the threshold should not be hard-coded and it's default should
> be like makeinfo's so that we don't need such workarounds:
>> A workaround I added to the Japanese edition of the Gnus Info is:
[...]
>> (require 'informat)
>> (let* ((fn (symbol-function 'Info-split))
>> (fns (prin1-to-string fn)))
>> (when (string-match "\\([\t\n ]+\\)50000\\([\t\n ]+\\)" fns)
>> (condition-case nil
>> (fset 'Info-split (read (replace-match "\\1200000\\2" nil nil fns)))
>> (error
>> (fset 'Info-split fn)))))
Thank you for following it up. How about the attached patch?
While the threshold of makeinfo is 30000, I tried it with some
texinfo files and reduced it a bit for `Info-split'. Now the
command ``./configure; make MAKEINFO=no info'' performed in the
Gnus trunk splits the Gnus Info into six files.
(Note that loaddefs.el, i.e. ldefs-boot.el, should be updated if
this patch is applied because of autoloading `Info-split-threshold'.)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 1732 bytes --]
--- informat.el~ 2008-05-06 07:57:40 +0000
+++ informat.el 2008-09-24 23:54:45 +0000
@@ -153,9 +153,16 @@
\f
;;;###autoload
+(defcustom Info-split-threshold 262144
+ "The number of characters by which `Info-split' splits an info file."
+ :type 'integer
+ :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 +174,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 +199,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)
--- textmodes/texinfmt.el~ 2008-07-31 21:47:43 +0000
+++ textmodes/texinfmt.el 2008-09-24 23:54:45 +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))))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: informat.el: `Info-split' split size
2008-09-24 23:58 ` informat.el: `Info-split' split size Katsumi Yamaoka
@ 2008-09-25 3:10 ` Eli Zaretskii
2008-09-25 4:01 ` Katsumi Yamaoka
2008-09-25 23:10 ` Katsumi Yamaoka
1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2008-09-25 3:10 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: ding, emacs-devel
> Date: Thu, 25 Sep 2008 08:58:06 +0900
> From: Katsumi Yamaoka <yamaoka@jpl.org>
> Cc: ding@gnus.org
>
> > ,----[ <f1> f Info-split RET ]
> >| Info-split is an interactive autoloaded Lisp function in `informat'.
> >| (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. [...]
> > `----
>
> > I think the threshold should not be hard-coded and it's default should
> > be like makeinfo's so that we don't need such workarounds:
>
> >> A workaround I added to the Japanese edition of the Gnus Info is:
> [...]
> >> (require 'informat)
> >> (let* ((fn (symbol-function 'Info-split))
> >> (fns (prin1-to-string fn)))
> >> (when (string-match "\\([\t\n ]+\\)50000\\([\t\n ]+\\)" fns)
> >> (condition-case nil
> >> (fset 'Info-split (read (replace-match "\\1200000\\2" nil nil fns)))
> >> (error
> >> (fset 'Info-split fn)))))
>
> Thank you for following it up. How about the attached patch?
> While the threshold of makeinfo is 30000, I tried it with some
^^^^^
You mean 300000, right?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: informat.el: `Info-split' split size
2008-09-25 3:10 ` Eli Zaretskii
@ 2008-09-25 4:01 ` Katsumi Yamaoka
0 siblings, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2008-09-25 4:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, ding
>>>>> Eli Zaretskii wrote:
>> While the threshold of makeinfo is 30000, I tried it with some
> ^^^^^
> You mean 300000, right?
Oops. You're right.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: informat.el: `Info-split' split size
2008-09-24 23:58 ` informat.el: `Info-split' split size Katsumi Yamaoka
2008-09-25 3:10 ` Eli Zaretskii
@ 2008-09-25 23:10 ` Katsumi Yamaoka
1 sibling, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2008-09-25 23:10 UTC (permalink / raw)
To: emacs-devel; +Cc: ding
>>>>> Katsumi Yamaoka wrote:
> While the threshold of makeinfo is 30000, I tried it with some
no, that's 300000 to be accurate
> texinfo files and reduced it a bit for `Info-split'. Now the
> command ``./configure; make MAKEINFO=no info'' performed in the
> Gnus trunk splits the Gnus Info into six files.
> (Note that loaddefs.el, i.e. ldefs-boot.el, should be updated if
> this patch is applied because of autoloading `Info-split-threshold'.)
> --- informat.el~ 2008-05-06 07:57:40 +0000
> +++ informat.el 2008-09-24 23:54:45 +0000
[...]
> +(defcustom Info-split-threshold 262144
> + "The number of characters by which `Info-split' splits an info file."
> + :type 'integer
> + :group 'texinfo)
I've installed the fix with ``:version "23.1"''.
Regards,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-25 23:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87abfkmuko.fsf@jondo.cante.net>
[not found] ` <b4md4kdco7f.fsf@jpl.org>
[not found] ` <86bpzlt5cq.fsf@lifelogs.com>
[not found] ` <87prnut63f.fsf@catnip.gol.com>
[not found] ` <86vdxlfdtn.fsf@lifelogs.com>
[not found] ` <87zlmwoyvs.fsf@marauder.physik.uni-ulm.de>
[not found] ` <86zlmvkg8p.fsf_-_@lifelogs.com>
[not found] ` <86vdwxnmzf.fsf_-_@lifelogs.com>
[not found] ` <8763ow9ssf.fsf@freemail.hu>
[not found] ` <86iqswnr9w.fsf@lifelogs.com>
[not found] ` <b4mtzcdujnu.fsf@jpl.org>
[not found] ` <86bpykjefp.fsf@lifelogs.com>
[not found] ` <87d4iuu0vc.fsf@marauder.physik.uni-ulm.de>
[not found] ` <b4md4iunzue.fsf@jpl.org>
2008-09-24 16:44 ` informat.el: `Info-split' split size (was: registry doc patch) Reiner Steib
2008-09-24 23:58 ` informat.el: `Info-split' split size Katsumi Yamaoka
2008-09-25 3:10 ` Eli Zaretskii
2008-09-25 4:01 ` Katsumi Yamaoka
2008-09-25 23:10 ` Katsumi Yamaoka
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).