GNU bug report logs - #13365
24.3.50; info node name completion busted

Previous Next

Package: emacs;

Reported by: emacs18 <at> gmail.com

Date: Sat, 5 Jan 2013 17:55:02 UTC

Severity: normal

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.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 13365 in the body.
You can then email your comments to 13365 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-gnu-emacs <at> gnu.org:
bug#13365; Package emacs. (Sat, 05 Jan 2013 17:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to emacs18 <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 05 Jan 2013 17:55:02 GMT) Full text and rfc822 format available.

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

From: emacs18 <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; info node name completion busted
Date: Sat, 05 Jan 2013 09:53:38 -0800
I use latest bzr trunk emacs that I compiled on linux.

Following is something I have done going back to emacs 18; launch
emacs, start info brower via C-h i, then type "g" to call
Info-goto-node, type "(emacs)" followed by RETURN.

Above no longer works.  Why?  Because we now have to use proper info
node name, i.e., I now have to type "(emacs)Top" instead of "(emacs)".
This is quite annoying to me.  IMHO a feature that has been around for
over 25 years is now busted.

This bug was introduced by Juri Linkov on Dec 27, 2012 via trunk
change set 11354.  The difff chunk in question is shown below.

I think this should be changed so that node names such as "(emacs)" is
allowed and interpreted same as if it was "(emacs)Top" as emacs has
done for over 25 years.


=== modified file 'lisp/info.el'
--- lisp/info.el	2012-12-08 23:12:08 +0000
+++ lisp/info.el	2012-12-27 20:42:02 +0000
@@ -1771,12 +1775,20 @@
      (substring string 1)
      predicate
      code))
-   ;; If a file name was given, then any node is fair game.
-   ((string-match "\\`(" string)
-    (cond
-     ((eq code nil) string)
-     ((eq code t) nil)
-     (t t)))
+   ;; If a file name was given, complete nodes in the file.
+   ((string-match "\\`(\\([^)]+\\))" string)
+    (let ((file0 (match-string 0 string))
+	  (file1 (match-string 1 string))
+	  (node (substring string (match-end 0))))
+      (completion-table-with-context
+       file0
+       (apply-partially
+	(lambda (string pred action)
+	  (complete-with-action
+	   action
+	   (Info-build-node-completions (Info-find-file file1))
+	   string pred)))
+       node predicate code)))
    ;; Otherwise use Info-read-node-completion-table.
    (t (complete-with-action
        code Info-read-node-completion-table string predicate))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13365; Package emacs. (Sat, 05 Jan 2013 22:54:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: emacs18 <at> gmail.com
Cc: 13365 <at> debbugs.gnu.org
Subject: Re: bug#13365: 24.3.50; info node name completion busted
Date: Sun, 06 Jan 2013 00:39:49 +0200
> Following is something I have done going back to emacs 18; launch
> emacs, start info brower via C-h i, then type "g" to call
> Info-goto-node, type "(emacs)" followed by RETURN.
>
> Above no longer works.  Why?

Thanks for the report.  This change was a result of the discussion
in http://debbugs.gnu.org/12456

> I think this should be changed so that node names such as "(emacs)" is
> allowed and interpreted same as if it was "(emacs)Top" as emacs has
> done for over 25 years.

I agree there is no reason to not allow empty node names to be
interpreted as "Top", despite the fact that this feature is not
documented anywhere and has been available for years by mere chance
(note the phrase "any node is fair game" in the old comment).

This could be improved by the patch below that will also legitimate
this feature in the docstring of `Info-read-node-name' and in the
Info reader manual.

BTW, do you think that `g RET' (without specifying a filename)
should also go to the Top node of the current Info file?
Currently it just recursively repeats the same query
that is not quite standard behavior for the minibuffer.

=== modified file 'lisp/info.el'
--- lisp/info.el	2013-01-03 00:36:36 +0000
+++ lisp/info.el	2013-01-05 22:39:39 +0000
@@ -1712,7 +1712,9 @@ (defun Info-goto-node (nodename &optiona
 If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file
 FILENAME; otherwise, NODENAME should be in the current Info file (or one of
 its sub-files).
-Completion is available, but only for node names in the current Info file.
+Completion is available for node names in the current Info file as well as
+in the Info file FILENAME after the closing parenthesis in (FILENAME).
+Empty NODENAME in (FILENAME) defaults to the node `Top'.
 If FORK is non-nil (interactively with a prefix arg), show the node in
 a new Info buffer.
 If FORK is a string, it is the name to use for the new buffer."
@@ -1802,6 +1804,9 @@ (defun Info-read-node-name-1 (string pre
     (let ((file0 (match-string 0 string))
 	  (file1 (match-string 1 string))
 	  (node (substring string (match-end 0))))
+      (if (and (equal node "") (eq code 'lambda))
+	  ;; Empty node name is permitted that means "Top".
+	  t
       (completion-table-with-context
        file0
        (apply-partially
@@ -1810,7 +1815,7 @@ (defun Info-read-node-name-1 (string pre
 	   action
 	   (Info-build-node-completions (Info-find-file file1))
 	   string pred)))
-       node predicate code)))
+	 node predicate code))))
    ;; Otherwise use Info-read-node-completion-table.
    (t (complete-with-action
        code Info-read-node-completion-table string predicate))))
@@ -1819,7 +1824,9 @@ (defun Info-read-node-name-1 (string pre
 (defun Info-read-node-name (prompt)
   "Read an Info node name with completion, prompting with PROMPT.
 A node name can have the form \"NODENAME\", referring to a node
-in the current Info file, or \"(FILENAME)NODENAME\"."
+in the current Info file, or \"(FILENAME)NODENAME\", referring to
+a node in FILENAME.  \"(FILENAME)\" is a short format to go to the
+node `Top' in FILENAME."
   (let* ((completion-ignore-case t)
 	 (Info-read-node-completion-table (Info-build-node-completions))
 	 (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))

=== modified file 'doc/misc/info.texi'
--- doc/misc/info.texi	2013-01-01 09:11:05 +0000
+++ doc/misc/info.texi	2013-01-05 22:39:36 +0000
@@ -1079,7 +1079,8 @@ (@pxref{Emacs Info Variables}).
 node name by putting it at the front, in parentheses.  Thus,
 @kbd{g(dir)Top <at> key{RET}} would go to the Info Directory node, which is
 the node @samp{Top} in the Info file @file{dir}.  Likewise,
-@kbd{g(emacs)Top <at> key{RET}} goes to the top node of the Emacs manual.
+@kbd{g(emacs)Top <at> key{RET}} or just @kbd{g(emacs)@key{RET}} goes to the
+top node of the Emacs manual.
 
   The node name @samp{*} specifies the whole file.  So you can look at
 all of the current file by typing @kbd{g*@key{RET}} or all of any





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13365; Package emacs. (Sun, 06 Jan 2013 03:59:01 GMT) Full text and rfc822 format available.

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

From: emacs18 <at> gmail.com
To: Juri Linkov <juri <at> jurta.org>
Cc: 13365 <at> debbugs.gnu.org
Subject: Re: bug#13365: 24.3.50; info node name completion busted
Date: Sat, 05 Jan 2013 19:58:35 -0800
Juri Linkov <juri <at> jurta.org> writes:

> BTW, do you think that `g RET' (without specifying a filename)
> should also go to the Top node of the current Info file?
> Currently it just recursively repeats the same query
> that is not quite standard behavior for the minibuffer.

I'm not sure.  To me `g RET' does not make sense.  The user has not made
his/her selection so I think we should disallow it or just force the
user to make a valid selection.  I don't know what the "standard
behavior" is these days, so I'll trust that you will know what is best.

I tested the change of list/info.el that you provded.
It seems to do exactly what I hoped it would do.

Thanks for such a quick fix.
Thanks also for taking time to improve the manual.




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Tue, 08 Jan 2013 00:14:01 GMT) Full text and rfc822 format available.

Notification sent to emacs18 <at> gmail.com:
bug acknowledged by developer. (Tue, 08 Jan 2013 00:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 13365-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: emacs18 <at> gmail.com
Cc: 13365-done <at> debbugs.gnu.org
Subject: Re: bug#13365: 24.3.50; info node name completion busted
Date: Tue, 08 Jan 2013 02:12:34 +0200
> I tested the change of list/info.el that you provded.
> It seems to do exactly what I hoped it would do.
> Thanks for such a quick fix.
> Thanks also for taking time to improve the manual.

Thanks for confirming the fix.  It is installed now and bug#13365 is closed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Feb 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 103 days ago.

Previous Next


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