GNU bug report logs - #14125
24.3; "No such node or anchor: Top" for Info files created by makeinfo 5.1

Previous Next

Package: emacs;

Reported by: Ulrich Mueller <ulm <at> gentoo.org>

Date: Tue, 2 Apr 2013 16:52:02 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14125 in the body.
You can then email your comments to 14125 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14125; Package emacs. (Tue, 02 Apr 2013 16:52:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Mueller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Apr 2013 16:52:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3;
	"No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Tue, 2 Apr 2013 18:47:43 +0200
[Message part 1 (text/plain, inline)]
Info-goto-node cannot find the "Top" node for some Info files
generated with makeinfo 5.1.

I've attached a minimal example of a Texinfo file where it fails.
To reproduce, save attached file as "test.texi".

   $ makeinfo --version
   makeinfo (GNU texinfo) 5.1
   [...]
   $ makeinfo --split-size=2000 test.texi
   $ ls -l test.info*
   -rw-r--r-- 1 ulm users  221 Apr  2 18:43 test.info
   -rw-r--r-- 1 ulm users 3017 Apr  2 18:43 test.info-1
   -rw-r--r-- 1 ulm users 1509 Apr  2 18:43 test.info-2
   $ emacs -Q
   C-h i
   g (/path/to/test.info) RET

The last command fails with an error: "No such node or anchor: Top"

The bug is not triggered if I use makeinfo 4.13 to create the Info
file from the same Texinfo source.

Not entirely sure if the problem is in Emacs or in makeinfo. I report
it here because standalone info (version 4.13 or 5.1) has no problem
with the files.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, X toolkit)
 of 2013-03-26 on a1i15
Windowing system distributor `The X.Org Foundation', version 11.0.11400000
System Description:	Gentoo Base System release 2.2

[test.texi (text/plain, inline)]
\input texinfo   @c -*-texinfo-*-
@c %**start of header
@setfilename test.info
@settitle Test
@c %**end of header

@ifnottex
lorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed
quia non numquam eius modi tempora incidunt, ut labore et dolore
magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis
nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut
aliquid ex ea commodi consequatur? quis autem vel eum iure
reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae
consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla
pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus,
qui blanditiis praesentium voluptatum deleniti atque corrupti, quos
dolores et quas molestias excepturi sint, obcaecati cupiditate non
provident, similique sunt in culpa, qui officia deserunt mollitia
animi, id est laborum et dolorum fuga. et harum quidem rerum facilis
est et expedita distinctio. nam libero tempore, cum soluta nobis est
eligendi optio, cumque nihil impedit, quo minus id, quod maxime
placeat, facere possimus, omnis voluptas assumenda est, omnis dolor
repellendus. temporibus autem quibusdam et aut officiis debitis aut
rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint
et molestiae non recusandae. itaque earum rerum hic tenetur a sapiente
delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut
perferendis doloribus asperiores repellat.
@end ifnottex

@titlepage
@title Test
@page
@vskip 0pt plus 1filll
@end titlepage

@ifnottex
@node Top
@top Test

@end ifnottex

@menu
* First Chapter::    The first chapter.
* Second Chapter::   The second chapter.
@end menu

@node First Chapter
@chapter First Chapter
lorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed
quia non numquam eius modi tempora incidunt, ut labore et dolore
magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis
nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut
aliquid ex ea commodi consequatur? quis autem vel eum iure
reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae
consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla
pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus,
qui blanditiis praesentium voluptatum deleniti atque corrupti, quos
dolores et quas molestias excepturi sint, obcaecati cupiditate non
provident, similique sunt in culpa, qui officia deserunt mollitia
animi, id est laborum et dolorum fuga. et harum quidem rerum facilis
est et expedita distinctio. nam libero tempore, cum soluta nobis est
eligendi optio, cumque nihil impedit, quo minus id, quod maxime
placeat, facere possimus, omnis voluptas assumenda est, omnis dolor
repellendus. temporibus autem quibusdam et aut officiis debitis aut
rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint
et molestiae non recusandae. itaque earum rerum hic tenetur a sapiente
delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut
perferendis doloribus asperiores repellat.

@node Second Chapter
@chapter Second Chapter
lorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed
quia non numquam eius modi tempora incidunt, ut labore et dolore
magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis
nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut
aliquid ex ea commodi consequatur? quis autem vel eum iure
reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae
consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla
pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus,
qui blanditiis praesentium voluptatum deleniti atque corrupti, quos
dolores et quas molestias excepturi sint, obcaecati cupiditate non
provident, similique sunt in culpa, qui officia deserunt mollitia
animi, id est laborum et dolorum fuga. et harum quidem rerum facilis
est et expedita distinctio. nam libero tempore, cum soluta nobis est
eligendi optio, cumque nihil impedit, quo minus id, quod maxime
placeat, facere possimus, omnis voluptas assumenda est, omnis dolor
repellendus. temporibus autem quibusdam et aut officiis debitis aut
rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint
et molestiae non recusandae. itaque earum rerum hic tenetur a sapiente
delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut
perferendis doloribus asperiores repellat.

@bye

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14125; Package emacs. (Wed, 03 Apr 2013 00:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 14125 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Ulrich Mueller <ulm <at> gentoo.org>
Cc: 14125 <at> debbugs.gnu.org
Subject: Re: bug#14125: 24.3;
	"No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Wed, 03 Apr 2013 02:47:05 +0300
> Info-goto-node cannot find the "Top" node for some Info files
> generated with makeinfo 5.1.

Thanks for the bug report.

> Not entirely sure if the problem is in Emacs or in makeinfo. I report
> it here because standalone info (version 4.13 or 5.1) has no problem
> with the files.

There is a difference between the output of makeinfo 4.13 and 5.1
that the Info reader doesn't handle.  I'm not sure whether it's a bug
in makeinfo 5.1 (maybe not) but in the tag table it outputs
the position of the beginning of the Info header of the indirect
Info file instead of the position of the beginning of the first node.

The following comment in `Info-find-node-2' in info.el:

	      ;; Now search from our advised position (or from beg of
	      ;; buffer) to find the actual node.  First, check
	      ;; whether the node is right where we are, in case the
	      ;; buffer begins with a node.

says that first it searches from the advised position (that is different
now in the Info files produced by makeinfo 5.1, so the reader overshoots).
If this fails it says that then it searches from the beginning of the
buffer (this would allow to find the Top node) but actually code doesn't do
what the comment says.  Currently I'm trying the solution that searches
from the beginning of the buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14125; Package emacs. (Tue, 30 Apr 2013 06:53:02 GMT) Full text and rfc822 format available.

Message #11 received at 14125 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 14125 <at> debbugs.gnu.org
Cc: bug-texinfo <at> gnu.org
Subject: Re: bug#14125: 24.3;
	"No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Tue, 30 Apr 2013 09:50:14 +0300
[Cc'ing to bug-texinfo for reference, thread started at
 http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-04/msg00039.html ]

> Info-goto-node cannot find the "Top" node for some Info files
> generated with makeinfo 5.1.

Makeinfo 5.0 changes in arithmetic of node positions in the tag table
makes Info files with the summary segment longer than a thousand characters
unreadable by the Emacs Info reader.

Makeinfo 4.13 produced the character positions of indirect subfiles
relative to the beginning of the first node, but Makeinfo 5.0 produces the
positions relative to the beginning of the subfile.  The Emacs Info reader
fails when the distance between the beginning of the subfile and
the beginning of its first node is longer than a thousand characters.

Both addressing schemes are valid and both make sense.  But to able to support
Info files produced by Makeinfo 5.0/1 the Emacs Info reader needs to be fixed.

The expression (+ (- nodepos lastfilepos) (point)) in `Info-read-subfile'
assumes that `lastfilepos' in `Info-read-subfile' is the beginning of the
first node, so for Info files produced by Makeinfo 4.13 it returns the
length of the summary segment, but for Makeinfo 5.0 it returns
two lengths of the summary segment.

The following patch changes it to return (point-min) for 4.13 and
the length of the summary segment for 5.0.  Since this code was merely
an optimization to skip the summary segment, this change shouldn't break
reading of Info files produced by Makeinfo 4.13 and older versions where
`Info-find-node-2' will start searching for the node in the summary segment.
However, this part of `Info-read-subfile'

    (if (looking-at "\^_")
	(forward-char 1)
      (search-forward "\n\^_"))

should be left unchanged for `Info-search' to not search in the summary segment.

The minimal patch to support all Makeinfo versions:

=== modified file 'lisp/info.el'
--- lisp/info.el	2013-04-22 06:41:30 +0000
+++ lisp/info.el	2013-04-30 06:49:35 +0000
@@ -1545,7 +1545,7 @@ (defun Info-read-subfile (nodepos)
 	(forward-char 1)
       (search-forward "\n\^_"))
     (if (numberp nodepos)
-	(+ (- nodepos lastfilepos) (point)))))
+	(+ (- nodepos lastfilepos) (point-min)))))
 
 (defun Info-unescape-quotes (value)
   "Unescape double quotes and backslashes in VALUE."





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14125; Package emacs. (Sun, 05 May 2013 04:42:01 GMT) Full text and rfc822 format available.

Message #14 received at 14125 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 14125 <at> debbugs.gnu.org, bug-texinfo <at> gnu.org
Subject: Re: bug#14125: 24.3;
	"No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Sun, 05 May 2013 00:40:36 -0400
> === modified file 'lisp/info.el'
> --- lisp/info.el	2013-04-22 06:41:30 +0000
> +++ lisp/info.el	2013-04-30 06:49:35 +0000
> @@ -1545,7 +1545,7 @@ (defun Info-read-subfile (nodepos)
>  	(forward-char 1)
>        (search-forward "\n\^_"))
>      (if (numberp nodepos)
> -	(+ (- nodepos lastfilepos) (point)))))
> +	(+ (- nodepos lastfilepos) (point-min)))))
 
>  (defun Info-unescape-quotes (value)
>    "Unescape double quotes and backslashes in VALUE."

I don't know enough about Info to judge whether that's right.
So if nobody objects, please install,


        Stefan




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Sun, 05 May 2013 08:53:02 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Mueller <ulm <at> gentoo.org>:
bug acknowledged by developer. (Sun, 05 May 2013 08:53:02 GMT) Full text and rfc822 format available.

Message #19 received at 14125-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14125-done <at> debbugs.gnu.org, bug-texinfo <at> gnu.org
Subject: Re: bug#14125: 24.3;
	"No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Sun, 05 May 2013 11:49:55 +0300
Version: 24.4

> So if nobody objects, please install,

I installed it to the trunk.  In case of releasing the next version
from emacs-24 branch it would make sense to backport it to that branch
before the next release (even though this is not a regression)
to support Info files with summaries longer than 1000 characters
created by makeinfo 5.1, sooner than later.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Jun 2013 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Juri Linkov <juri <at> jurta.org> to control <at> debbugs.gnu.org. (Sat, 24 Aug 2013 23:45:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14125; Package emacs. (Sun, 25 Aug 2013 00:12:01 GMT) Full text and rfc822 format available.

Message #26 received at 14125 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Patrice Dumas <pertusus <at> free.fr>
Cc: 14125 <at> debbugs.gnu.org, bug-texinfo <at> gnu.org
Subject: Re: bug#14125: 24.3;
 "No such node or anchor: Top" for Info files created by makeinfo 5.1
Date: Sun, 25 Aug 2013 02:54:55 +0300
> I think that this was a bug, bytes of text appearing before the
> first node were not correctly counted, but the behaviour you describe
> should be the correct one (we even documented it in the info
> specification part of the Texinfo manual).
>
> It was compounded by a backward incompatible change of not having the
> same preamble for an info subfiles, as explained to me by Sergey.
>
> Not having the same preamble, especially for the first node with the tag
> table and the other could well become the norm after some decades, so,
> in general, if you can make the Info reader as robust as possible (if
> not already), that would be fine.
>
> The standalone info reader has an option --strict-node-location and you
> can see that it had trouble with your test when using that option,
> which should show that there is an issue in the Info file.

I believe we made the Emacs Info reader robust enough to handle
both old and new formats of preamble.  Regarding the option
--strict-node-location in the standalone Info reader,
we could create a similar option in the Emacs Info reader
with a name like `Info-strict-node-location', but I doubt
that many users might want to use it since it's intended
for debugging, and Emacs has a built-in debugger for that.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Sep 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.