Subject: bug#72787: 31.0.50; Invalid describe-function completion candidates

From: Eshel Yaron <[email-masked]>
Date: Sun, 13 Oct 2024 09:35:04 +0200

Hi Stefan,

Stefan Monnier writes:

>>>> AFAIU, the feature here would be loading library foo just in time for
>>>> you to get help about symbol foo-bar.
>
> Actually, it's not so much for the case where you know you want to see
> `foo-bar` (which should be handled by `help-enable-symbol-autoload`
> already) but also to let you discover that there might be a `foo-bar`
> because there's a `foo-`.

I see, so this is meant as a hint that should aid with discoverability.
Perhaps annotating these prefix candidates could make that more obvious:
I'm not sure that seeing "foo-" in *Completions* immediately suggests
"try to complete this prefix to see more candidates".

>>>> So I suggest doing one of the following:
>>>> - implement the feature differently, without this side-effect; or
>
> I'm all for it but I don't know what that would look like.

Personally I don't see this use case as important enough to break the
invariant that completion candidates are valid inputs, so I'd go a
different route.  The ability to load possibly-relevant libraries from
within the minibuffer is great, but I think that providing a command
that does that on demand would provide the same benefits.  Basically,
you would press a key when you want to check if some unloaded maybe
library defines something relevant.  Such a command could take into
account the current minibuffer input, so it can be as efficient as the
current facility. I can share a prototype if that sounds intriguing.

Best,

Eshel