aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Gunbin2014-12-31 17:14:33 +0300
committerFilipp Gunbin2014-12-31 17:15:36 +0300
commitf588156cbc7b15d6c5c2da3b1cd0e3d56df937b6 (patch)
tree4e9cc9b49b2b8f44328d1d751243d9fd33cad304
parent25346768fac53687c97c213fb99ff18fa805b073 (diff)
downloademacs-f588156cbc7b15d6c5c2da3b1cd0e3d56df937b6.tar.gz
emacs-f588156cbc7b15d6c5c2da3b1cd0e3d56df937b6.zip
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.
-rw-r--r--CONTRIBUTE10
-rw-r--r--doc/misc/info.texi5
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/info.el19
5 files changed, 31 insertions, 13 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE
index 0e019d31597..5cf015fe11a 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -180,10 +180,12 @@ by following links from http://savannah.gnu.org/mail/?group=emacs .
180 180
181Any change that matters to end-users should have an entry in etc/NEWS. 181Any change that matters to end-users should have an entry in etc/NEWS.
182 182
183Think about whether your change requires updating the documentation 183Doc-strings should be updated together with the code.
184(both manuals and doc-strings). If you know it does not, mark the NEWS 184
185entry with "---". If you know that *all* the necessary documentation 185Think about whether your change requires updating the manuals. If you
186updates have been made, mark the entry with "+++". Otherwise do not mark it. 186know it does not, mark the NEWS entry with "---". If you know
187that *all* the necessary documentation updates have been made, mark
188the entry with "+++". Otherwise do not mark it.
187 189
188** Understanding Emacs Internals. 190** Understanding Emacs Internals.
189 191
diff --git a/doc/misc/info.texi b/doc/misc/info.texi
index a3a14a35b80..0e2e64f2356 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.
1151 If you have created many Info buffers in Emacs, you might find it 1151 If you have created many Info buffers in Emacs, you might find it
1152difficult to remember which buffer is showing which manual. You can 1152difficult to remember which buffer is showing which manual. You can
1153use the command @kbd{M-x info-display-manual} to show an Info manual 1153use the command @kbd{M-x info-display-manual} to show an Info manual
1154by name, reusing an existing buffer if there is one. 1154by name, reusing an existing buffer if there is one. When given a
1155prefix argument, this command limits the completion alternatives to
1156currently visited info files, thus giving a convenient way to switch
1157between several manuals.
1155 1158
1156@node Emacs Info Variables 1159@node Emacs Info Variables
1157@section Emacs Info-mode Variables 1160@section Emacs Info-mode Variables
diff --git a/etc/NEWS b/etc/NEWS
index ae0cb70c833..ec5fe0d9061 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -338,6 +338,11 @@ The remainder were:
338--- 338---
339** `Info-fontify-maximum-menu-size' can be t for no limit. 339** `Info-fontify-maximum-menu-size' can be t for no limit.
340 340
341+++
342** `info-display-manual' can now be given a prefix argument which (any
343non-nil value) directs the command to limit the completion
344alternatives to currently visited manuals.
345
341--- 346---
342** ntlm.el has support for NTLM2. 347** ntlm.el has support for NTLM2.
343 348
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4203e05aed8..acafe24674a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-12-31 Filipp Gunbin <fgunbin@fastmail.fm>
2
3 * info.el (info-display-manual): Limit the completion alternatives
4 to currently visited manuals if prefix argument is non-nil.
5
12014-12-30 Paul Eggert <eggert@cs.ucla.edu> 62014-12-30 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * Makefile.in (semantic): Simplify. 8 * Makefile.in (semantic): Simplify.
diff --git a/lisp/info.el b/lisp/info.el
index 7c4d7f33231..33e982d3a77 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -5277,13 +5277,15 @@ type returned by `Info-bookmark-make-record', which see."
5277(defun info-display-manual (manual) 5277(defun info-display-manual (manual)
5278 "Display an Info buffer displaying MANUAL. 5278 "Display an Info buffer displaying MANUAL.
5279If there is an existing Info buffer for MANUAL, display it. 5279If there is an existing Info buffer for MANUAL, display it.
5280Otherwise, visit the manual in a new Info buffer." 5280Otherwise, visit the manual in a new Info buffer. In interactive
5281use, a prefix argument directs this command to limit the
5282completion alternatives to currently visited manuals."
5281 (interactive 5283 (interactive
5282 (list 5284 (list
5283 (progn 5285 (progn
5284 (info-initialize) 5286 (info-initialize)
5285 (completing-read "Manual name: " 5287 (completing-read "Manual name: "
5286 (info--manual-names) 5288 (info--manual-names current-prefix-arg)
5287 nil t)))) 5289 nil t))))
5288 (let ((blist (buffer-list)) 5290 (let ((blist (buffer-list))
5289 (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)")) 5291 (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
@@ -5302,7 +5304,7 @@ Otherwise, visit the manual in a new Info buffer."
5302 (info (Info-find-file manual) 5304 (info (Info-find-file manual)
5303 (generate-new-buffer-name "*info*"))))) 5305 (generate-new-buffer-name "*info*")))))
5304 5306
5305(defun info--manual-names () 5307(defun info--manual-names (visited-only)
5306 (let (names) 5308 (let (names)
5307 (dolist (buffer (buffer-list)) 5309 (dolist (buffer (buffer-list))
5308 (with-current-buffer buffer 5310 (with-current-buffer buffer
@@ -5313,11 +5315,12 @@ Otherwise, visit the manual in a new Info buffer."
5313 (file-name-nondirectory Info-current-file)) 5315 (file-name-nondirectory Info-current-file))
5314 names)))) 5316 names))))
5315 (delete-dups (append (nreverse names) 5317 (delete-dups (append (nreverse names)
5316 (all-completions 5318 (when (not visited-only)
5317 "" 5319 (all-completions
5318 (apply-partially 'Info-read-node-name-2 5320 ""
5319 Info-directory-list 5321 (apply-partially 'Info-read-node-name-2
5320 (mapcar 'car Info-suffix-list))))))) 5322 Info-directory-list
5323 (mapcar 'car Info-suffix-list))))))))
5321 5324
5322(provide 'info) 5325(provide 'info)
5323 5326