GNU bug report logs - #397
23.0.60; T in Info when in (dir)

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Thu, 12 Jun 2008 16:00:04 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 397 <at> debbugs.gnu.org
Subject: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 10:46:38 -0700 (PDT)
> 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))
	(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")




This bug report was last modified 3 years and 120 days ago.

Previous Next


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