Commit f588156c authored by Filipp Gunbin's avatar Filipp Gunbin

Use prefix argument in `info-display-manual'

* lisp/info.el (info-display-manual): Limit the completion alternatives
to currently visited manuals if prefix argument is non-nil.
parent 25346768
...@@ -180,10 +180,12 @@ by following links from http://savannah.gnu.org/mail/?group=emacs . ...@@ -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. Any change that matters to end-users should have an entry in etc/NEWS.
Think about whether your change requires updating the documentation Doc-strings should be updated together with the code.
(both manuals and doc-strings). If you know it does not, mark the NEWS
entry with "---". If you know that *all* the necessary documentation Think about whether your change requires updating the manuals. If you
updates have been made, mark the entry with "+++". Otherwise do not mark it. 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. ** Understanding Emacs Internals.
......
...@@ -1151,7 +1151,10 @@ switches to the buffer @file{*info*<2>}, creating it if necessary. ...@@ -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 If you have created many Info buffers in Emacs, you might find it
difficult to remember which buffer is showing which manual. You can 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 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 @node Emacs Info Variables
@section Emacs Info-mode Variables @section Emacs Info-mode Variables
......
...@@ -338,6 +338,11 @@ The remainder were: ...@@ -338,6 +338,11 @@ The remainder were:
--- ---
** `Info-fontify-maximum-menu-size' can be t for no limit. ** `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. ** ntlm.el has support for NTLM2.
......
2014-12-31 Filipp Gunbin <fgunbin@fastmail.fm>
* info.el (info-display-manual): Limit the completion alternatives
to currently visited manuals if prefix argument is non-nil.
2014-12-30 Paul Eggert <eggert@cs.ucla.edu> 2014-12-30 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in (semantic): Simplify. * Makefile.in (semantic): Simplify.
......
...@@ -5277,13 +5277,15 @@ type returned by `Info-bookmark-make-record', which see." ...@@ -5277,13 +5277,15 @@ type returned by `Info-bookmark-make-record', which see."
(defun info-display-manual (manual) (defun info-display-manual (manual)
"Display an Info buffer displaying MANUAL. "Display an Info buffer displaying MANUAL.
If there is an existing Info buffer for MANUAL, display it. 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 (interactive
(list (list
(progn (progn
(info-initialize) (info-initialize)
(completing-read "Manual name: " (completing-read "Manual name: "
(info--manual-names) (info--manual-names current-prefix-arg)
nil t)))) nil t))))
(let ((blist (buffer-list)) (let ((blist (buffer-list))
(manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)")) (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
...@@ -5302,7 +5304,7 @@ Otherwise, visit the manual in a new Info buffer." ...@@ -5302,7 +5304,7 @@ Otherwise, visit the manual in a new Info buffer."
(info (Info-find-file manual) (info (Info-find-file manual)
(generate-new-buffer-name "*info*"))))) (generate-new-buffer-name "*info*")))))
(defun info--manual-names () (defun info--manual-names (visited-only)
(let (names) (let (names)
(dolist (buffer (buffer-list)) (dolist (buffer (buffer-list))
(with-current-buffer buffer (with-current-buffer buffer
...@@ -5313,11 +5315,12 @@ Otherwise, visit the manual in a new Info buffer." ...@@ -5313,11 +5315,12 @@ Otherwise, visit the manual in a new Info buffer."
(file-name-nondirectory Info-current-file)) (file-name-nondirectory Info-current-file))
names)))) names))))
(delete-dups (append (nreverse names) (delete-dups (append (nreverse names)
(all-completions (when (not visited-only)
"" (all-completions
(apply-partially 'Info-read-node-name-2 ""
Info-directory-list (apply-partially 'Info-read-node-name-2
(mapcar 'car Info-suffix-list))))))) Info-directory-list
(mapcar 'car Info-suffix-list))))))))
(provide 'info) (provide 'info)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment