aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-12-05 14:14:11 +0800
committerChong Yidong2012-12-05 14:14:11 +0800
commit04b14f2b275b064440ca8366cd5b7c4effcdac82 (patch)
treec20c99d5321e627f861f4370ba8a39655815e349
parent066f0e09bc17809beeb6b6c20e3032d0f4420795 (diff)
downloademacs-04b14f2b275b064440ca8366cd5b7c4effcdac82.tar.gz
emacs-04b14f2b275b064440ca8366cd5b7c4effcdac82.zip
Improve completion behavior of info-display-manual.
* lisp/info.el (info-display-manual): Add existing Info buffers, whose files may not be in Info-directory-list, to the completion. (info--manual-names): New helper function.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/info.el18
2 files changed, 21 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 45fa38042a0..77eed9ed918 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-12-05 Chong Yidong <cyd@gnu.org>
2
3 * info.el (info-display-manual): Add existing Info buffers, whose
4 files may not be in Info-directory-list, to the completion.
5 (info--manual-names): New helper function.
6
12012-12-05 Glenn Morris <rgm@gnu.org> 72012-12-05 Glenn Morris <rgm@gnu.org>
2 8
3 * vc/vc-hg.el (vc-hg-resolve-when-done, vc-hg-find-file-hook): 9 * vc/vc-hg.el (vc-hg-resolve-when-done, vc-hg-find-file-hook):
diff --git a/lisp/info.el b/lisp/info.el
index 6149c3fcd80..2c2d485e245 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -5105,9 +5105,7 @@ Otherwise, visit the manual in a new Info buffer."
5105 (progn 5105 (progn
5106 (info-initialize) 5106 (info-initialize)
5107 (completing-read "Manual name: " 5107 (completing-read "Manual name: "
5108 (apply-partially 'Info-read-node-name-2 5108 (info--manual-names)
5109 Info-directory-list
5110 (mapcar 'car Info-suffix-list))
5111 nil t)))) 5109 nil t))))
5112 (let ((blist (buffer-list)) 5110 (let ((blist (buffer-list))
5113 (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)")) 5111 (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
@@ -5126,6 +5124,20 @@ Otherwise, visit the manual in a new Info buffer."
5126 (info (Info-find-file manual) 5124 (info (Info-find-file manual)
5127 (generate-new-buffer-name "*info*"))))) 5125 (generate-new-buffer-name "*info*")))))
5128 5126
5127(defun info--manual-names ()
5128 (let (names)
5129 (dolist (buffer (buffer-list))
5130 (with-current-buffer buffer
5131 (and (eq major-mode 'Info-mode)
5132 (stringp Info-current-file)
5133 (push (file-name-sans-extension
5134 (file-name-nondirectory Info-current-file))
5135 names))))
5136 (delete-dups (append (nreverse names)
5137 (apply-partially 'Info-read-node-name-2
5138 Info-directory-list
5139 (mapcar 'car Info-suffix-list))))))
5140
5129(provide 'info) 5141(provide 'info)
5130 5142
5131;;; info.el ends here 5143;;; info.el ends here