私はC-h f頻繁に使用しますが、これはEmacsのすべての機能です。私はしばしば、対話型の機能、つまりコマンドにのみ興味があります。
コマンドに相当するものはありますか?理想としては、イドも完成させたいです。
私はC-h f頻繁に使用しますが、これはEmacsのすべての機能です。私はしばしば、対話型の機能、つまりコマンドにのみ興味があります。
コマンドに相当するものはありますか?理想としては、イドも完成させたいです。
回答:
はい。ライブラリhelp-fns+.elはコマンドを定義しますdescribe-command。
そして、それを再定義するdescribe-functionのでdescribe-command、接頭辞argを与えた場合にそうなります。
ライブラリがバインドdescribe-commandしますC-h c(describe-key-brieflyに移動しますC-h C-c)。
同じライブラリーは、次のような他のヘルプコマンドを定義しdescribe-file、describe-buffer、describe-keymap、とdescribe-option-of-type。ライブラリの詳細はこちらです。
apropos-command 十分近いかもしれません。
describe-functionのタブ補完機能はありませんが、コマンドを介してのみ検索でき、ドキュメントページに移動します。
このビルトインが見つかりません。describe-function対話的に呼び出されたときにのみコマンド名を補完するラッパーを作成するのはかなり簡単です。以下の実装では、インタラクティブフォームを複製しdescribe-function、fboundpテストをに変更しましたcommandp。追加のボーナスとして、この関数は、プレフィックス引数で呼び出されたときにすべての関数名を提供します。に変更if current-prefix-argしif (not current-prefix-arg)て、すべての機能の説明をデフォルトにします。
(defun describe-command (function &optional all-functions)
"Display the full documentation of FUNCTION (a symbol).
When called interactively with a prefix argument, prompt for all functions,
not just interactive commands, like `describe-function'."
(interactive (if current-prefix-arg
(eval (car (cdr (interactive-form 'describe-function))))
(list (let ((fn (function-called-at-point))
(enable-recursive-minibuffers t)
val)
(setq val (completing-read (if (and fn (commandp fn))
(format "Describe command (default %s): " fn)
"Describe command: ")
obarray 'commandp t nil nil
(and fn (commandp fn)
(symbol-name fn))))
(if (equal val "") fn (intern val)))
current-prefix-arg)))
(describe-function function))
私はこれをidoでテストしていませんが、正常に統合されるはずです。
*scratch*、評価され、実行されましたM-x describe-command。コマンドは、のおかげで垂直リストに表示されましたido-vertical。
(describe-function command)どうでしょうか?