Subject: bug#19443: closed (Re: bug#19443: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 31 Dec 2014 15:45:03 +0000

Your bug report

#19443: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19443: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19443
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19443: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience
From: Filipp Gunbin <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Wed, 31 Dec 2014 18:44:28 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On 30/12/2014 18:10 +0200, Eli Zaretskii wrote:

>> From: Filipp Gunbin <[email-masked]>
>> Cc: Glenn Morris <[email-masked]>,  [email-masked]
>> Date: Tue, 30 Dec 2014 14:46:30 +0300
>> 
>> 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?
>
> LGTM, thanks.

Applied.

Subject: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience
From: Filipp Gunbin <[email-masked]>
To: [email-masked]
Date: Fri, 26 Dec 2014 20:06:45 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Here's the patch on the subject.  I'll apply it if no one objects.

Filipp

diff --git a/etc/NEWS b/etc/NEWS
index 14933aa..9e0c9c7 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 choice of manual to
+currently visited manuals.
+
 ---
 ** ntlm.el has support for NTLM2.
 
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a2bee14..3119d80 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-26  Filipp Gunbin  <[email-masked]>
+
+	* info.el (info-display-manual): Limit the choice of manuals to
+	currently visited if prefix argument is non-nil.
+
 2014-12-25  Helmut Eller  <[email-masked]>
             Dmitry Gutov  <[email-masked]>
 
diff --git a/lisp/info.el b/lisp/info.el
index 7c4d7f3..c5e3b21 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 choice
+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)