From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#19443: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience Date: Tue, 30 Dec 2014 14:46:30 +0300 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419940038 9466 80.91.229.3 (30 Dec 2014 11:47:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2014 11:47:18 +0000 (UTC) Cc: 19443@debbugs.gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 30 12:47:12 2014 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 1Y5vGZ-0006sJ-Ek for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 12:47:11 +0100 Original-Received: from localhost ([::1]:36594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5vGY-0003BX-OI for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 06:47:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5vGU-0003BR-Lx for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 06:47:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5vGQ-0002Q5-H7 for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 06:47:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5vGQ-0002Pz-Df for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 06:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y5vGP-0000Ya-VV for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2014 06:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Dec 2014 11:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19443 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19443-submit@debbugs.gnu.org id=B19443.14199400052110 (code B ref 19443); Tue, 30 Dec 2014 11:47:01 +0000 Original-Received: (at 19443) by debbugs.gnu.org; 30 Dec 2014 11:46:45 +0000 Original-Received: from localhost ([127.0.0.1]:60754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5vG8-0000Xx-UL for submit@debbugs.gnu.org; Tue, 30 Dec 2014 06:46:45 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42773) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5vFz-0000XX-08 for 19443@debbugs.gnu.org; Tue, 30 Dec 2014 06:46:41 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5C8C220BC0 for <19443@debbugs.gnu.org>; Tue, 30 Dec 2014 06:46:34 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 30 Dec 2014 06:46:34 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=m+OAyGy3Mffy y7SktuqvuhH0r9Q=; b=HCPYnusN+qAzl/e75OLo1ftuF7RbxT75ny0d2Pwqrz3A BMUT6r4tpe3BDmB3/odBBXlmN6CCVAhERZoVH1lUsEYMvk9pql5XZN3Sahm2oNu4 GRK204NYSywFPBXUFPrxv0eKae5pdrSXcCPL6oe6ODNM6Ha4+XpW0D9bZQKudzg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=m+OAyGy3Mffyy7SktuqvuhH0r9Q=; b=gzamDYALhSU77ZfmMhjz A1LftfC3wlvA4s+AJ6xE5ucI90bkSwCrl9wZobndU4DsLipR9kyihexLTDf0DFmv 3H9dA8RHmb26rSYaxXVzjG+cnYUD3lbmCJ4sayod7wqfT2qXiW2UrhN3NZACDyYA OHYNHmOz9r9p7hx9F/dlrFc= X-Sasl-enc: 5W66E/8EgYJ4NB76du7Puh8LNKi+YjV7W9wgMF4dJ+43 1419939993 Original-Received: from fgunbin.local (unknown [94.25.218.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 347CCC00283; Tue, 30 Dec 2014 06:46:33 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Sat, 27 Dec 2014 10:16:16 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:97832 Archived-At: On 27/12/2014 10:16 -0500, Stefan Monnier wrote: >> "Think about whether your change requires updating the documentation >> (both manuals and doc-strings). If you know it does not, mark the NEWS >> entry with "---". If you know that *all* the necessary documentation >> updates have been made, mark the entry with "+++". Otherwise do not mark >> it." > > The --- and +++ in etc/NEWS only relate to the manual. > The docstrings should *always* be updated right away. > > > Stefan Thanks Stefan and Eli, Here's the revised patch. I also updated the CONTRIBUTE file in accordance with what you wrote. Could you please review? Filipp diff --git a/CONTRIBUTE b/CONTRIBUTE index 0e019d3..5cf015f 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -180,10 +180,12 @@ by following links from http://savannah.gnu.org/mail/?group=emacs . Any change that matters to end-users should have an entry in etc/NEWS. -Think about whether your change requires updating the documentation -(both manuals and doc-strings). If you know it does not, mark the NEWS -entry with "---". If you know that *all* the necessary documentation -updates have been made, mark the entry with "+++". Otherwise do not mark it. +Doc-strings should be updated together with the code. + +Think about whether your change requires updating the manuals. If you +know it does not, mark the NEWS entry with "---". If you know +that *all* the necessary documentation updates have been made, mark +the entry with "+++". Otherwise do not mark it. ** Understanding Emacs Internals. diff --git a/doc/misc/info.texi b/doc/misc/info.texi index a3a14a3..0e2e64f 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -1151,7 +1151,10 @@ switches to the buffer @file{*info*<2>}, creating it if necessary. If you have created many Info buffers in Emacs, you might find it difficult to remember which buffer is showing which manual. You can use the command @kbd{M-x info-display-manual} to show an Info manual -by name, reusing an existing buffer if there is one. +by name, reusing an existing buffer if there is one. When given a +prefix argument, this command limits the completion alternatives to +currently visited info files, thus giving a convenient way to switch +between several manuals. @node Emacs Info Variables @section Emacs Info-mode Variables diff --git a/etc/NEWS b/etc/NEWS index ae0cb70..ec5fe0d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -338,6 +338,11 @@ The remainder were: --- ** `Info-fontify-maximum-menu-size' can be t for no limit. ++++ +** `info-display-manual' can now be given a prefix argument which (any +non-nil value) directs the command to limit the completion +alternatives to currently visited manuals. + --- ** ntlm.el has support for NTLM2. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6249a30..86ed70f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-30 Filipp Gunbin + + * info.el (info-display-manual): Limit the completion alternatives + to currently visited manuals if prefix argument is non-nil. + 2014-12-30 Dmitry Gutov * menu-bar.el (menu-bar-goto-uses-etags-p): New function. diff --git a/lisp/info.el b/lisp/info.el index 7c4d7f3..33e982d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -5277,13 +5277,15 @@ type returned by `Info-bookmark-make-record', which see." (defun info-display-manual (manual) "Display an Info buffer displaying MANUAL. If there is an existing Info buffer for MANUAL, display it. -Otherwise, visit the manual in a new Info buffer." +Otherwise, visit the manual in a new Info buffer. In interactive +use, a prefix argument directs this command to limit the +completion alternatives to currently visited manuals." (interactive (list (progn (info-initialize) (completing-read "Manual name: " - (info--manual-names) + (info--manual-names current-prefix-arg) nil t)))) (let ((blist (buffer-list)) (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)")) @@ -5302,7 +5304,7 @@ Otherwise, visit the manual in a new Info buffer." (info (Info-find-file manual) (generate-new-buffer-name "*info*"))))) -(defun info--manual-names () +(defun info--manual-names (visited-only) (let (names) (dolist (buffer (buffer-list)) (with-current-buffer buffer @@ -5313,11 +5315,12 @@ Otherwise, visit the manual in a new Info buffer." (file-name-nondirectory Info-current-file)) names)))) (delete-dups (append (nreverse names) - (all-completions - "" - (apply-partially 'Info-read-node-name-2 - Info-directory-list - (mapcar 'car Info-suffix-list))))))) + (when (not visited-only) + (all-completions + "" + (apply-partially 'Info-read-node-name-2 + Info-directory-list + (mapcar 'car Info-suffix-list)))))))) (provide 'info)