diff options
author | Chong Yidong <cyd@gnu.org> | 2012-12-05 14:14:11 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-12-05 14:14:11 +0800 |
commit | 04b14f2b275b064440ca8366cd5b7c4effcdac82 (patch) | |
tree | c20c99d5321e627f861f4370ba8a39655815e349 | |
parent | 066f0e09bc17809beeb6b6c20e3032d0f4420795 (diff) | |
download | emacs-04b14f2b275b064440ca8366cd5b7c4effcdac82.tar.gz |
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/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/info.el | 18 |
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 @@ +2012-12-05 Chong Yidong <cyd@gnu.org> + + * 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. + 2012-12-05 Glenn Morris <rgm@gnu.org> * 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." (progn (info-initialize) (completing-read "Manual name: " - (apply-partially 'Info-read-node-name-2 - Info-directory-list - (mapcar 'car Info-suffix-list)) + (info--manual-names) nil t)))) (let ((blist (buffer-list)) (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)")) @@ -5126,6 +5124,20 @@ Otherwise, visit the manual in a new Info buffer." (info (Info-find-file manual) (generate-new-buffer-name "*info*"))))) +(defun info--manual-names () + (let (names) + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (and (eq major-mode 'Info-mode) + (stringp Info-current-file) + (push (file-name-sans-extension + (file-name-nondirectory Info-current-file)) + names)))) + (delete-dups (append (nreverse names) + (apply-partially 'Info-read-node-name-2 + Info-directory-list + (mapcar 'car Info-suffix-list)))))) + (provide 'info) ;;; info.el ends here |