From: Chong Yidong <cyd@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 10771@debbugs.gnu.org
Subject: bug#10771: TAB completion for info-display-manual
Date: Mon, 03 Dec 2012 14:57:14 +0800 [thread overview]
Message-ID: <87y5hf1v3p.fsf@gnu.org> (raw)
In-Reply-To: <83mwxvst4d.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 03 Dec 2012 05:37:54 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> At least this is not worse than the original command that reads a
>> manual name without completion.
>
> I didn't say it was worse. I asked how it was better.
How about adding existing Info buffers' manual names to the completion
table too, like the following?
=== modified file 'lisp/info.el'
*** lisp/info.el 2012-12-02 06:41:22 +0000
--- lisp/info.el 2012-12-03 06:55:15 +0000
***************
*** 5105,5113 ****
(progn
(info-initialize)
(completing-read "Manual name: "
! (apply-partially 'Info-read-node-name-2
! Info-directory-list
! (mapcar 'car Info-suffix-list))
nil t))))
(let ((blist (buffer-list))
(manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
--- 5105,5111 ----
(progn
(info-initialize)
(completing-read "Manual name: "
! (info--manual-names)
nil t))))
(let ((blist (buffer-list))
(manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
***************
*** 5126,5131 ****
--- 5124,5143 ----
(info (Info-find-file manual)
(generate-new-buffer-name "*info*")))))
+ (defun info--manual-names ()
+ (let (names)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (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 names
+ (apply-partially 'Info-read-node-name-2
+ Info-directory-list
+ (mapcar 'car Info-suffix-list))))))
+
(provide 'info)
;;; info.el ends here
next prev parent reply other threads:[~2012-12-03 6:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 6:36 bug#10771: TAB completion for info-display-manual Glenn Morris
2012-02-09 9:28 ` Juri Linkov
2012-02-09 18:42 ` Eli Zaretskii
2012-02-10 10:17 ` Juri Linkov
2012-12-02 6:44 ` Chong Yidong
2012-12-02 17:25 ` Eli Zaretskii
2012-12-02 21:12 ` Juri Linkov
2012-12-02 21:32 ` Eli Zaretskii
2012-12-02 21:57 ` Juri Linkov
2012-12-03 3:37 ` Eli Zaretskii
2012-12-03 6:57 ` Chong Yidong [this message]
2012-12-03 16:31 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5hf1v3p.fsf@gnu.org \
--to=cyd@gnu.org \
--cc=10771@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.