bug-texinfo
[Top][All Lists]
Advanced

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

Missing first index entry


From: Sergey Matveev
Subject: Missing first index entry
Date: Tue, 22 Feb 2022 15:46:36 +0300
User-agent: Mutt/2.2.1 GnuPG/2.3.4 Vim/8.2 FreeBSD/12.0-RELEASE (amd64)

Greetings!

I have got strange issues (a bug?) with Texinfo 6.8's info command.

First of all, according to info/indices.c:info_indices_of_file_buffer
and its "if (strcasestr (tag->nodename, "Index") ..." check, at looks
and indices only if node's name contains "Index" word in it. For example
I have got that .texi:

          ------------------------ >8 ------------------------
\input texinfo
@documentencoding UTF-8
@settitle foo

@node Top
@top foo

@node Foo
@unnumbered Foo
@cindex football
Something about football.

@node Bar
@unnumbered Bar
@cindex basketball
Something about basketball.

@node My
@unnumbered My

@printindex cp

@bye
          ------------------------ >8 ------------------------

run "makeinfo foo.texi" and info ./foo.info says that no indices found
on "i"/"I" commands. If I rename "My" node to "My Index", then info
won't note about missing indices. I did not find explicit note about
that requirement.

If I try to search "i foot<Enter>", then it finds "FOOTball" section and
jumps to it as expected. But "i basket<Enter>" does not find anything.
However "i basketball<Enter>" works as expected. "I ball<Enter>" shows
only "football" entry. "I basket<Enter>" does not produce anything.
"I foot<Enter>" works as expected.

When I tried to find how index entries are found and filled, I was sure
that index_index variable is properly filled with two ("football",
"basketball") entries.

I think that something wrong is going in next_index_match function with
the cycles like: for (i = offset + dir; i > -1 && index_index[i]; i += dir)
where offset=0, dir=1 and that means initial i's value is 1, so it "skips"
the first entry in index_index.

If I add "@cindex aaa" (to be sure that it goes first after sort) before
"@top foo", then all "i foot", "i bask", "I ball" work as expected.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF



reply via email to

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