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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 397 in the body.
You can then email your comments to 397 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#397; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.60; T in Info when in (dir)
Date: Thu, 12 Jun 2008 08:53:07 -0700
`T' in Info when you are at the directory level (dir), should either
raise an error or DTRT.
 
To DTRT, it could do either of these:
 
- return to the directory listing (which is useless),
  which is the top-level TOC
- show the contents of all manuals (pretty costly),
  which is the detailed TOC
 
Currently, what `T' does is worse than useless. It shows this, where
(dir) and the second Top are links to the same place - the directory
you just came from:
 
 Up: (dir)
 File: toc,  Node: Top
 
 Table of Contents
 *****************
 
 Top.
 
This is not only useless; it is wrong. Top cannot be the same thing as
(dir), but both links lead to the same place. And the Top listed as
the current node is different from the destination of the Top link.
 
Please, at a minimum, (1) raise an error if `T' is used in the
directory (dir), and (2) disable (dim) the corresponding item in the
Info menu when in (dir).
 
 
 
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-05-29 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
 





Severity set to `wishlist' from `normal' Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Mon, 28 Jul 2008 14:35:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 16:12:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 18:11:45 +0200
"Drew Adams" <drew.adams <at> oracle.com> writes:

> `T' in Info when you are at the directory level (dir), should either
> raise an error or DTRT.
>
> To DTRT, it could do either of these:
>
> - return to the directory listing (which is useless),
>   which is the top-level TOC
> - show the contents of all manuals (pretty costly),
>   which is the detailed TOC
>
> Currently, what `T' does is worse than useless. It shows this, where
> (dir) and the second Top are links to the same place - the directory
> you just came from:
>
>  Up: (dir)
>  File: toc,  Node: Top
>
>  Table of Contents
>  *****************
>
>  Top.

This seems like it's fixed now.  If I `T' in the top level node, it just
says "user-error: No such node or anchor: *TOC*".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 397 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 27 Apr 2016 16:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 16:43:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 397 <at> debbugs.gnu.org
Subject: RE: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 09:42:35 -0700 (PDT)

> -----Original Message-----
> From: Lars Ingebrigtsen [mailto:larsi <at> gnus.org]
> Sent: Wednesday, April 27, 2016 9:12 AM
> To: Drew Adams
> Cc: 397 <at> debbugs.gnu.org
> Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
> 
> "Drew Adams" <drew.adams <at> oracle.com> writes:
> 
> > `T' in Info when you are at the directory level (dir), should either
> > raise an error or DTRT.
> >
> > To DTRT, it could do either of these:
> >
> > - return to the directory listing (which is useless),
> >   which is the top-level TOC
> > - show the contents of all manuals (pretty costly),
> >   which is the detailed TOC
> >
> > Currently, what `T' does is worse than useless. It shows this, where
> > (dir) and the second Top are links to the same place - the directory
> > you just came from:
> >
> >  Up: (dir)
> >  File: toc,  Node: Top
> >
> >  Table of Contents
> >  *****************
> >
> >  Top.
> 
> This seems like it's fixed now.  If I `T' in the top level node, it just
> says "user-error: No such node or anchor: *TOC*".

Thanks, but that is not the whole fix.  You missed this part:

    and (2) disable (dim) the corresponding item in the
    Info menu when in (dir).

The Info menu correctly has things like Up disabled (dimmed).
But menu item Table of Contents (T) is not disabled.
Please fix this part of the bug also.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 Apr 2016 16:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 16:48:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 18:47:03 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Thanks, but that is not the whole fix.  You missed this part:
>
>     and (2) disable (dim) the corresponding item in the
>     Info menu when in (dir).
>
> The Info menu correctly has things like Up disabled (dimmed).
> But menu item Table of Contents (T) is not disabled.
> Please fix this part of the bug also.

Hm...  I don't quite follow.  Do you have a complete recipe, starting
from -Q?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 17:13:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 397 <at> debbugs.gnu.org
Subject: RE: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 10:12:25 -0700 (PDT)
> > Thanks, but that is not the whole fix.  You missed this part:
> >
> >     and (2) disable (dim) the corresponding item in the
> >     Info menu when in (dir).
> >
> > The Info menu correctly has things like Up disabled (dimmed).
> > But menu item Table of Contents (T) is not disabled.
> > Please fix this part of the bug also.
> 
> Hm...  I don't quite follow.  Do you have a complete recipe, starting
> from -Q?

emacs -Q
C-h i

Look at the Info menu, in the menu bar.  See the menu item
`Table of Contents           T'?  It should be disabled
when at the (dir), i.e., the top, level.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 17:36:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 19:35:05 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

>> > Thanks, but that is not the whole fix.  You missed this part:
>> >
>> >     and (2) disable (dim) the corresponding item in the
>> >     Info menu when in (dir).
>> >
>> > The Info menu correctly has things like Up disabled (dimmed).
>> > But menu item Table of Contents (T) is not disabled.
>> > Please fix this part of the bug also.
>> 
>> Hm...  I don't quite follow.  Do you have a complete recipe, starting
>> from -Q?
>
> emacs -Q
> C-h i
>
> Look at the Info menu, in the menu bar.  See the menu item
> `Table of Contents           T'?  It should be disabled
> when at the (dir), i.e., the top, level.

Oh, I see.  I didn't think you meant the Emacs menu menu, but a menu in
the Info buffer.  :-)

Let's see...  Yes, that menu item should be dimmed.

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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 17:47:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 397 <at> debbugs.gnu.org
Subject: RE: 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")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 17:59:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: larsi <at> gnus.org, 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 20:58:21 +0300
> Date: Wed, 27 Apr 2016 10:46:38 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 397 <at> debbugs.gnu.org
> 
> `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 "@@@@@@@@@@@@@@@@@"))

So, from now on, no Info manual can be called "dir" or "dir.info", or
suchlikes?  Does dimming an option in a rarely-used menu really
justify this?  I don't think so.

We should look for a better solution, if one exists.  If it doesn't,
then it isn't a catastrophe to have that option be available and fail
if invoked where it cannot work.  No one who knows something about
Info will invoke that function in this situation, anyway.

> But probably not.  `Info-index' does only this:
> (equal Info-current-file "dir")

Bad, bad Info-index!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 18:11:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: larsi <at> gnus.org, 397 <at> debbugs.gnu.org
Subject: RE: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 11:09:54 -0700 (PDT)
> > `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 "@@@@@@@@@@@@@@@@@"))
> 
> So, from now on, no Info manual can be called "dir" or "dir.info", or
> suchlikes?  Does dimming an option in a rarely-used menu really
> justify this?  I don't think so.

It was a quick-and-dirty implementation suggestion.  I don't
argue for that implementation.

If we put the "real" code for this into an :enable menu guard
then that guard would be (Info-find-node "dir" "*TOC*").

And in the case of your hypothetical manual named "dir", there
could be such a *TOC* node, and in that case the menu item would
be correctly enabled.

> We should look for a better solution, if one exists.  If it doesn't,
> then it isn't a catastrophe to have that option be available and fail
> if invoked where it cannot work.  No one who knows something about
> Info will invoke that function in this situation, anyway.

Fair enough.  Someone might actually try it: use the :enable
guard (Info-find-node "dir" "*TOC*") and see whether it is
in fact onerous.  If it is then I agree with (both of) you:
we can do without disabling the menu item.

> > But probably not.  `Info-index' does only this:
> > (equal Info-current-file "dir")
> 
> Bad, bad Info-index!

;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 18:23:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 397 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 20:22:07 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> So, from now on, no Info manual can be called "dir" or "dir.info", or
> suchlikes?

dir has always been special.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 18:29:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 20:28:15 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Fair enough.  Someone might actually try it: use the :enable
> guard (Info-find-node "dir" "*TOC*") and see whether it is
> in fact onerous.  If it is then I agree with (both of) you:
> we can do without disabling the menu item.

Well, using it as is doesn't really work, because it does a lot
of... stuff.

Here's how it starts:

(defun Info-find-node-2 (filename nodename &optional no-going-back strict-case)
  (buffer-disable-undo (current-buffer))
  (or (derived-mode-p 'Info-mode)
      (Info-mode))
  (widen)
  (setq Info-current-node nil)
  (unwind-protect
      (let ((case-fold-search t)
	    (virtual-fun (Info-virtual-fun 'find-node
					   (or filename Info-current-file)
					   nodename))
	    anchorpos)
	(cond
	 ((functionp virtual-fun)
	  (let ((filename (or filename Info-current-file)))
	    (setq buffer-read-only nil)
	    (setq Info-current-file filename
		  Info-current-subfile nil
		  Info-current-file-completions nil
		  buffer-file-name nil)
	    (erase-buffer)

So that's not the right thing to use.

(Info-virtual-fun 'find-node "dir" "*TOC*")
=> Info-directory-find-node

(defun Info-directory-find-node (_filename _nodename &optional _no-going-back)
  "Directory-specific implementation of `Info-find-node-2'."
  (Info-insert-dir))

...

(defun Info-insert-dir ()
  (if (and Info-dir-contents Info-dir-file-attributes
	   ;; Verify that none of the files we used has changed
	   ;; since we used it.
	   (eval (cons 'and
		       (mapcar (lambda (elt)
				 (let ((curr (file-attributes
					      ;; Handle symlinks
					      (file-truename (car elt)))))


And down the rabbit hole we go.  Why are we calling that function and
ignoring the parameters?  It's all very confusing.

So does somebody know what the real way to find out whether a node
exists is?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Wed, 27 Apr 2016 19:29:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: larsi <at> gnus.org, 397 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Wed, 27 Apr 2016 22:27:59 +0300
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Drew Adams <drew.adams <at> oracle.com>,  larsi <at> gnus.org,  397 <at> debbugs.gnu.org
> Date: Wed, 27 Apr 2016 20:22:07 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > So, from now on, no Info manual can be called "dir" or "dir.info", or
> > suchlikes?
> 
> dir has always been special.

It's name is special, but its structure could be anything, and could
support a TOC.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Sat, 30 Apr 2016 20:11:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, Andreas Schwab <schwab <at> linux-m68k.org>, 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Sat, 30 Apr 2016 23:08:04 +0300
>> > So, from now on, no Info manual can be called "dir" or "dir.info", or
>> > suchlikes?
>>
>> dir has always been special.
>
> It's name is special, but its structure could be anything, and could
> support a TOC.

I remember an idea to display a table of contents of (usually very long)
dir itself with a list of its section names.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#397; Package emacs. (Mon, 21 Mar 2022 22:07:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 397 <at> debbugs.gnu.org
Subject: Re: bug#397: 23.0.60; T in Info when in (dir)
Date: Mon, 21 Mar 2022 23:06:18 +0100
I think the conclusion here was that it would be prohibitively expensive
to grey out the menu bar item here, so I'm closing this as a wontfix.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Mar 2022 22:07:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 397 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Mar 2022 22:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Apr 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 6 days ago.

Previous Next


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