Thank you for this package. A feature request or a request for discussion.
Emacs 28.1 has introduced the shortdoc feature. From the NEWS file:
** New system for displaying documentation for groups of functions.
This can either be used by saying 'M-x shortdoc-display-group' and
choosing a group, or clicking a button in the "Help" buffers when
looking at the doc string of a function that belongs to one of these
groups.
In shortdoc, I like how related functions are grouped into themes like "sequence" or "alist". Also there is a capability to add "sections". I do not like how shortcut function buttons automatically opens to the Info manual (info-lookup-symbol function 'emacs-lisp-mode)
. It should just do a describe-function
or helpful-function
.
Desired new functionality:
- (feature 1) Add elisp-demos to existing shortdoc entries (like seq-contains-p), in an optional way.
- (feature 2) Reuse shortdoc examples into elisp-demos, in an optional way.
- (feature 3) Group non-grouped functions via elisp-demos.el, in an optional way.
Feature 1: Directly showing a elisp-demo example alongside a shortdoc feature render would be great. I would mitigate this feature request by overriding the button to just show the result of describe-function
or helpful-function
.
Feature 2: Since elisp-demos are only shown in describe-function
or helpful-function
result buffers, and those buffers already show a link to the shortcut group, discoverability of the shortdoc example is only slightly enhanced.
Feature 3: This perhaps is not functionality that elisp-demos needs to support, but it would be nice. I notice despite cl-lib.el being a built-in library, there is no shortdoc. How would elisp-demos support this feature? In either elisp-demos.org or a new file, have a way to easily to say this feature belongs to a group and an optional section. If a non-shortdoc package becomes supported officially, the official support would take precedence. Also adding this support would make elisp-demos a place to collect the grouping/sectioning efforts of the community together.
Also shortdoc doesn't seem to require that a function belong to one group or subsection, so any associations defined by elisp-demos can be alternately offered as separate group, like "elisp-demos-sequence" or "user/sequence".
Since package authors sometimes offer an info file, the grouping of functions in the info file can be reused. Ultimately it would probably be better for the package author to support shortdoc directly, though.