On Wed, Mar 17, 2010 at 05:30:21PM +0200, Sergey Poznyakoff wrote:
> Patrice Dumas <[email protected]> ha escrit:
> 
> > In my opinion, this option --strict-node-count is not really useful 
> > for anything else than debugging (info documents, and maybe the info
> > reader). Therefore I didn't document it. How should it be documented?
> > In --help? In doc/info-stnd.texi? Nowhere?
> 
> In my opinion, it should be documented both in --help and in info-stnd.

Here it is. I am not particularly happy with the sentence in --help,
but I am not a native english speaker...

--
Pat
? cvsup
? strict-node-location-switch.patch
? texi2html/ABOUT-NLS
? texi2html/cvsup
? texi2html/locales
? texi2html/m4
? texi2html/makeinfo.out
? texi2html/texi2any.out
? texi2html/test/formatting/empty_deftype.info
? texi2html/test/formatting/res/allowcodebreaks
? texi2html/test/info_coverage/split-nocopying.info
? texi2html/test/manuals/hello
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1032
diff -u -3 -p -r1.1032 ChangeLog
--- ChangeLog	17 Mar 2010 15:40:23 -0000	1.1032
+++ ChangeLog	17 Mar 2010 18:12:52 -0000
@@ -1,3 +1,10 @@
+2010-03-18  Patrice Dumas  <[email protected]>
+
+	* info/nodes.c (info_node_of_file_buffer_tags), info.c, info.h,
+	doc/info-stnd.texi:
+	new switch --strict-node-location to avoid being smart when 
+	searching for nodes.
+
 2010-03-17  Karl Berry  <[email protected]>
 
 	* doc/texinfo.txi (Include Files): move to near the end of the
Index: doc/info-stnd.texi
===================================================================
RCS file: /sources/texinfo/texinfo/doc/info-stnd.texi,v
retrieving revision 1.27
diff -u -3 -p -r1.27 info-stnd.texi
--- doc/info-stnd.texi	16 Mar 2009 12:41:57 -0000	1.27
+++ doc/info-stnd.texi	17 Mar 2010 18:12:53 -0000
@@ -307,6 +307,14 @@ to the video memory on these systems, fo
 display support.)  This allows the speech synthesizers used by blind
 persons to catch the output and convert it to audible speech.
 
+...@item --strict-node-location 
+This option causes Info not to search around when locating a node, and 
+instead sticks to the information provided in the tag table in the info 
+file. In general it is advisable not to use this option, since a 
+malformed info file will become useless even if it is only slightly
+incorrect. The main use for this option is to be able to check that 
+node locations are correctly setup in an info manual.
+
 @item --subnodes
 @cindex @code{--subnodes}, command line option
 This option only has meaning when given in conjunction with
Index: doc/version-stnd.texi
===================================================================
RCS file: /sources/texinfo/texinfo/doc/version-stnd.texi,v
retrieving revision 1.44
diff -u -3 -p -r1.44 version-stnd.texi
--- doc/version-stnd.texi	20 Mar 2009 18:33:52 -0000	1.44
+++ doc/version-stnd.texi	17 Mar 2010 18:12:53 -0000
@@ -1,4 +1,4 @@
-...@set UPDATED 16 March 2009
-...@set UPDATED-MONTH March 2009
+...@set UPDATED 17 March 2010
+...@set UPDATED-MONTH March 2010
 @set EDITION 4.13
 @set VERSION 4.13
Index: info/info.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/info.c,v
retrieving revision 1.33
diff -u -3 -p -r1.33 info.c
--- info/info.c	14 Aug 2008 17:36:13 -0000	1.33
+++ info/info.c	17 Mar 2010 18:12:53 -0000
@@ -82,6 +82,9 @@ int raw_escapes_p = 1;
 /* Non-zero means print the absolute location of the file to be loaded.  */
 static int print_where_p = 0;
 
+/* Non-zero means don't try to be smart when searching for nodes.  */
+int strict_node_location_p = 0;
+
 #ifdef __MSDOS__
 /* Non-zero indicates that screen output should be made 'speech-friendly'.
    Since on MSDOS the usual behavior is to write directly to the video
@@ -113,6 +116,7 @@ static struct option long_options[] = {
   { "no-show-malformed-multibytes", 0, &show_malformed_multibyte_p, 0 },
   { "restore", 1, 0, RESTORE_OPTION },
   { "show-options", 0, 0, 'O' },
+  { "strict-node-location", 0, &strict_node_location_p, 1 },
   { "subnodes", 0, &dump_subnodes, 1 },
   { "usage", 0, 0, 'O' },
   { "version", 0, &print_version_p, 1 },
@@ -628,6 +632,7 @@ Options:\n\
 #endif
 
   puts (_("\
+      --strict-node-location   locate nodes without any searching.\n\
       --subnodes               recursively output menu items.\n\
       --vi-keys                use vi-like and less-like key bindings.\n\
       --version                display version information and exit.\n\
Index: info/info.h
===================================================================
RCS file: /sources/texinfo/texinfo/info/info.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 info.h
--- info/info.h	10 May 2008 14:39:05 -0000	1.9
+++ info/info.h	17 Mar 2010 18:12:53 -0000
@@ -126,6 +126,9 @@ extern int vi_keys_p;
 /* Non-zero means don't remove ANSI escape sequences from man pages.  */
 extern int raw_escapes_p;
 
+/* Non-zero means don't try to be smart when searching for nodes.  */
+extern int strict_node_location_p;
+
 /* Print FORMAT with ARG1 and ARG2.  If the window system was initialized,
    then the message is printed in the echo area.  Otherwise, a message is
    output to stderr. */
Index: info/nodes.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/nodes.c,v
retrieving revision 1.13
diff -u -3 -p -r1.13 nodes.c
--- info/nodes.c	23 Jan 2009 09:37:40 -0000	1.13
+++ info/nodes.c	17 Mar 2010 18:12:53 -0000
@@ -998,10 +998,16 @@ info_node_of_file_buffer_tags (FILE_BUFF
 
               min = max = DEFAULT_INFO_FUDGE;
 
-              if (tag->nodestart < DEFAULT_INFO_FUDGE)
+              if (strict_node_location_p)
+                {
+                  min = 0;
+                  max = 2;
+                }
+
+              if (tag->nodestart < min)
                 min = tag->nodestart;
 
-              if (DEFAULT_INFO_FUDGE >
+              if (max >
                   (subfile->filesize - tag->nodestart))
                 max = subfile->filesize - tag->nodestart;
 

Reply via email to