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#13365: 24.3.50; info node name completion busted Date: Sun, 06 Jan 2013 00:39:49 +0200 Organization: JURTA Message-ID: <877gnrfe28.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357426435 8633 80.91.229.3 (5 Jan 2013 22:53:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2013 22:53:55 +0000 (UTC) Cc: 13365@debbugs.gnu.org To: emacs18@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 05 23:54:10 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 1Trccz-0006s9-21 for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Jan 2013 23:54:09 +0100 Original-Received: from localhost ([::1]:41987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Trccj-0004Rr-NY for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Jan 2013 17:53:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Trccf-0004Rk-AZ for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2013 17:53:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Trccd-00085K-T8 for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2013 17:53:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Trccd-00085F-PP for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2013 17:53:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Trccr-00040y-RT for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2013 17:54:01 -0500 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: Sat, 05 Jan 2013 22:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13365 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13365-submit@debbugs.gnu.org id=B13365.135742638715410 (code B ref 13365); Sat, 05 Jan 2013 22:54:01 +0000 Original-Received: (at 13365) by debbugs.gnu.org; 5 Jan 2013 22:53:07 +0000 Original-Received: from localhost ([127.0.0.1]:46379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Trcby-00040V-Oy for submit@debbugs.gnu.org; Sat, 05 Jan 2013 17:53:07 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:54554 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Trcbv-00040Q-Cr for 13365@debbugs.gnu.org; Sat, 05 Jan 2013 17:53:06 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id C4F1F2019C7A22; Sat, 5 Jan 2013 14:52:46 -0800 (PST) In-Reply-To: (emacs's message of "Sat, 05 Jan 2013 09:53:38 -0800") 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:69423 Archived-At: > 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@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@key{RET}} goes to the top node of the Emacs manual. +@kbd{g(emacs)Top@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