unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: 14125@debbugs.gnu.org
Cc: bug-texinfo@gnu.org
Subject: 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	[thread overview]
Message-ID: <87zjwgd1qx.fsf__37857.6510739096$1367304772$gmane$org@mail.jurta.org> (raw)
In-Reply-To: <20827.2991.777277.325096@a1i15.kph.uni-mainz.de> (Ulrich Mueller's message of "Tue, 2 Apr 2013 18:47:43 +0200")

[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."






  parent reply	other threads:[~2013-04-30  6:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 16:47 bug#14125: 24.3; "No such node or anchor: Top" for Info files created by makeinfo 5.1 Ulrich Mueller
2013-04-02 23:47 ` Juri Linkov
2013-04-30  6:50 ` Juri Linkov [this message]
     [not found] ` <87zjwgd1qx.fsf@mail.jurta.org>
2013-05-05  4:40   ` Stefan Monnier
2013-05-05  8:49     ` Juri Linkov
     [not found]   ` <20130824071927.GA8566@free.fr>
2013-08-24 23:54     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='87zjwgd1qx.fsf__37857.6510739096$1367304772$gmane$org@mail.jurta.org' \
    --to=juri@jurta.org \
    --cc=14125@debbugs.gnu.org \
    --cc=bug-texinfo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).