From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#397: 23.0.60; T in Info when in (dir) Date: Wed, 27 Apr 2016 10:46:38 -0700 (PDT) Message-ID: <5a64ed8a-d9c7-4b33-b63a-11d83b7dab99@default> References: <007c01c8cca4$686e6fb0$c2b22382@us.oracle.com> <87eg9rhvzy.fsf@gnus.org> <285bd041-cb56-4d42-a085-88605bd08f44@default> <87twingfso.fsf@gnus.org> <72369d48-65c7-4468-9d49-21dcb045cdf2@default> <8760v3gdkm.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1461779246 8566 80.91.229.3 (27 Apr 2016 17:47:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Apr 2016 17:47:26 +0000 (UTC) Cc: 397@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 27 19:47:13 2016 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 1avTYP-0003Eq-Jo for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Apr 2016 19:47:13 +0200 Original-Received: from localhost ([::1]:44518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avTYP-0004Yd-0H for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Apr 2016 13:47:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avTYL-0004WB-6O for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2016 13:47:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avTYE-0003D3-Of for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2016 13:47:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avTYE-0003Cz-LR for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2016 13:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1avTYE-0006vt-HJ for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2016 13:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Apr 2016 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 397-submit@debbugs.gnu.org id=B397.146177920826627 (code B ref 397); Wed, 27 Apr 2016 17:47:02 +0000 Original-Received: (at 397) by debbugs.gnu.org; 27 Apr 2016 17:46:48 +0000 Original-Received: from localhost ([127.0.0.1]:50437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avTY0-0006vO-B2 for submit@debbugs.gnu.org; Wed, 27 Apr 2016 13:46:48 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:28623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avTXz-0006vC-3J for 397@debbugs.gnu.org; Wed, 27 Apr 2016 13:46:47 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u3RHke3v022068 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Apr 2016 17:46:41 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u3RHkeVE013052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Apr 2016 17:46:40 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u3RHke3c007710; Wed, 27 Apr 2016 17:46:40 GMT In-Reply-To: <8760v3gdkm.fsf@gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:116938 Archived-At: > Basically, Info calls > (Info-find-node "dir" "*TOC*") > which then fails. Looking at that code, it's quite long and convoluted, > and calling that just to gray out the menu item is probably not a good > idea. Does anybody know of a quick shortcut to determine whether the > TOC isn't available? I'm quite unfamiliar with the Info code. `Info-toc' should raise an error immediately, if the current node is the top. Something like this, perhaps: (defun Info-toc () "@@@@@@@@@" (interactive) (when (equal Info-current-file "dir") (error "@@@@@@@@@@@@@@@@@")) (Info-find-node Info-current-file "*TOC*") (let ((prev-node (nth 1 (car Info-history))) p) (goto-char (point-min)) (if (setq p (search-forward (concat "*Note " prev-node ":") nil t)) =09(setq p (- p (length prev-node) 2))) (goto-char (or p (point-min))))) But you might need to worry about different versions of "dir", such as is done in function `Info-insert-dir'. Dunno. I took only a quick look. Maybe you also need to check for the node name being "top", as in `Info-directory' - dunno. But probably not. `Info-index' does only this: (equal Info-current-file "dir")