From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: JURTA Message-ID: <87zjwgd1qx.fsf__37857.6510739096$1367304772$gmane$org@mail.jurta.org> References: <20827.2991.777277.325096@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1367304768 23839 80.91.229.3 (30 Apr 2013 06:52:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Apr 2013 06:52:48 +0000 (UTC) Cc: bug-texinfo@gnu.org To: 14125@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 30 08:52:47 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UX4Qh-0003HH-3e for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2013 08:52:47 +0200 Original-Received: from localhost ([::1]:54007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX4Qg-0006q6-Qa for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2013 02:52:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX4Qc-0006pt-Rh for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 02:52:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UX4Qb-0004AF-Co for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 02:52:42 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX4Qb-0004AA-8q for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 02:52:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UX4Qw-00058L-7z for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 02:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2013 06:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14125 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14125-submit@debbugs.gnu.org id=B14125.136730473119605 (code B ref 14125); Tue, 30 Apr 2013 06:53:02 +0000 Original-Received: (at 14125) by debbugs.gnu.org; 30 Apr 2013 06:52:11 +0000 Original-Received: from localhost ([127.0.0.1]:51431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UX4Q3-000563-J4 for submit@debbugs.gnu.org; Tue, 30 Apr 2013 02:52:11 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:58796 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UX4Pv-00055U-Pe for 14125@debbugs.gnu.org; Tue, 30 Apr 2013 02:52:04 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5F53A258B9E91C; Mon, 29 Apr 2013 23:51:36 -0700 (PDT) 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") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73843 Archived-At: [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."