aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorFilipp Gunbin2014-12-31 17:14:33 +0300
committerFilipp Gunbin2014-12-31 17:15:36 +0300
commitf588156cbc7b15d6c5c2da3b1cd0e3d56df937b6 (patch)
tree4e9cc9b49b2b8f44328d1d751243d9fd33cad304 /lisp
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/info.el19
2 files changed, 16 insertions, 8 deletions
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