reddit / emacs
Can 'M-x' be made to display the docstrings of the functions?
vfclists · 2022-06-11 05:41
Can 'M-x' be made to display the docstrings of the functions along side the functions themselves?
Having lots of functions with similar names can be confusing including those you wrote yourself.
UPDATE:
Solution for `helm-M-x`. It also works on Emacs 27
In the case of `helm-M-x` the function for toggling display of the short-docs is `helm-M-x-toggle-short-doc` and the default key is `C-]` in `helm-M-x-mode-map`.
As helm runs in the current buffer if it isn't wide enough the docstrings will word-wrap so it works better in wider buffers.
[Github issue - Support for Emacs 28.1 completions-detailed parameter](https://github.com/emacs-helm/helm/issues/2496#)
[deleted] · 2022-06-11 05:54
[removed]
usaoc · 2022-06-11 06:25
Check out [Marginalia](https://github.com/minad/marginalia).
vfclists · 2022-06-11 07:11
I've looked at it. Does it mean I have to give up helm and ivy?
The docs speak of some kind of `:annotation-function` to get it to work with other packages. Do you know of any for `helm` and `ivy`?
usaoc · 2022-06-11 07:17
You don’t have to. This package is very general.
molteanu · 2022-06-11 10:29
Yes, if you're using ivy/counsel, then there is a package (ivy-rich) on top of it for adding all kinds of info to `M-x`, but also to `C-h f` (describe-function), `C-h v` (describe-variable), etc.
Check out the [package](https://github.com/Yevgnen/ivy-rich) itself and some [screenshots](https://github.com/Yevgnen/ivy-rich/blob/master/screenshots.org)
00-11 · 2022-06-11 17:25
Related, at least:
With [Icicles](https://www.emacswiki.org/emacs/Icicles), whenever completion candidates are things that have doc strings (functions, variables, defcustom groups, faces, etc.):
* By default, the first doc-string line of the current candidate is shown in the mode-line of buffer `*Completions*`.
* You can pop up the complete doc string of the current candidate anytime.
("Current candidate": The candidate you've moved to when you cycle among candidates or otherwise move among them.)
wargxs · 2022-06-11 19:54
Is icicles on GitHub / Gotland yet?
00-11 · 2022-06-12 02:10
No. You can [download it from Emacs Wiki](https://www.emacswiki.org/emacs/Icicles_-_Libraries#BulkIciclesDownload).
wargxs · 2022-06-12 05:55
As long as it sits there it will never be popular ..
oantolin · 2022-06-12 16:19
Ivy supports Marginalia out of the box (nowadays). Another option for ivy is the ivy-rich package. I don't know about similar things for Helm, but it seems very likely they exist.
vfclists · 2022-06-12 17:41
I will update my Ivy installation and see. It is a long time since I updated my packages.
00-11 · 2022-06-12 22:36
I'm not in a popularity contest, and neither is Icicles. Do you care?
vfclists · 2022-06-13 01:59
I turned on `ivy-rich-mode` after I switched to `counsel-M-x` after disabling it I see that `marginalia-mode` works with it.
Thanks.
vfclists · 2022-06-14 16:10
Solution for `helm-M-x`. It also works on Emacs 27
In the case of `helm-M-x` the function for toggling display of the short-docs is `helm-M-x-toggle-short-doc` and the default key is `C-]` in `helm-M-x-mode-map`.
As helm runs in the current buffer if it isn't wide enough the docstrings will word-wrap so it works better in wider buffers.
[Github issue - Support for Emacs 28.1 completions-detailed parameter](https://github.com/emacs-helm/helm/issues/2496#)