2

which-key package is very useful to show the list of command names. Could it (or any other package) also show the doc string of those commands?

1

If you use Icicles then you have key completion.

This is similar to which-key behavior, but there are differences.

You can use key completion anytime, whether you have already pressed a prefix key or not. To initiate key completion just hit S-TAB (or M-S-TAB if in the minibuffer) when you are not otherwise in the middle of completing something. (When you are completing something S-TAB performs apropos completion.)

Key-completion candidates are the completing key sequence, followed by =, followed by the name of the command the key sequence is bound to. For example, if you use C-x and then you hit S-TAB to complete that prefix key, you see candidates such as these:

( = kmacro-start-macro

* = calc-dispatch

- = shrink-window-if-larger-than-buffer

1 = delete-other-windows

4 = ...

The last of these is an example of showing a prefix key. C-x 4 is, like C-x, a prefix key. If you choose that candidate then you see all of the completions of that prefix key...

There is also this pseudo key-completion candidate, which is first in the list: ... If you choose that candidate then you move up the prefix-key hierarchy, e.g., from the keys that complete, say, C-x 4 to those that complete C-x.

As always in Icicles, you can get the complete doc string (shown in buffer *Help*) for any completion candidate, using C-M-RET or other candidate-help keys.

In addition, the first line of the doc string for the current completion candidate is shown in the mode-line of the *Completions* window. For a prefix-key candidate the mode-line shows Prefix key. And for pseudo-candidate .. the mode-line shows GO UP.

So for example, if you cycle among candidates using down, down, down... then you see the first line of each candidate, in turn, in the mode line. And if you cycle using C-M-down, C-M-down, C-M-down... then you see the complete doc string of each candidate, in turn, in buffer *Help*.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.