unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: 19443@debbugs.gnu.org
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: Fri, 26 Dec 2014 20:06:45 +0300	[thread overview]
Message-ID: <m2sig2cpcq.fsf@fastmail.fm> (raw)

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  <fgunbin@fastmail.fm>
+
+	* info.el (info-display-manual): Limit the choice of manuals to
+	currently visited if prefix argument is non-nil.
+
 2014-12-25  Helmut Eller  <eller.helmut@gmail.com>
             Dmitry Gutov  <dgutov@yandex.ru>
 
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)





             reply	other threads:[~2014-12-26 17:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-26 17:06 Filipp Gunbin [this message]
2014-12-26 20:37 ` bug#19443: 25.0.50; `info-display-manual' could limit the choice to currently visited manuals if given a prefix arg for convenience Glenn Morris
2014-12-27  0:00   ` Filipp Gunbin
2014-12-27  7:33     ` Eli Zaretskii
2014-12-27 16:01       ` Stefan Monnier
2014-12-27 18:34         ` Eli Zaretskii
2014-12-27 15:16     ` Stefan Monnier
2014-12-30 11:46       ` Filipp Gunbin
2014-12-30 16:10         ` Eli Zaretskii
2014-12-31 15:44           ` Filipp Gunbin
2014-12-26 21:55 ` Eli Zaretskii
2014-12-27  0:08   ` Filipp Gunbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2sig2cpcq.fsf@fastmail.fm \
    --to=fgunbin@fastmail.fm \
    --cc=19443@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).