Thanks for the clarification,

> Yes, dynamically adding completion at least for the subcommand name is
> important, otherwise overlapping prefixes will make it appear that the
> dynamically installed subcommand isn't present.

For the plugin support, I tested the dynamic completion after applying
the null check fix using this:
time COMP_WORDS="mailman " COMP_CWORD=1 _MAILMAN_COMPLETE=bash_complete mailman

This gave a real-world latency of about 534 ms of calling Mailman
dynamically on every Tab press on my machine. I feel it's pretty
noticeable.
Would this latency be acceptable, or would you prefer a different
approach? I had two approaches in my mind:

1. Dynamic completion only for subcommand names, with static
completion for options and choice values, the 534 ms latency would
only occur when the user Tabs after mailman to see subcommand names,
not for any subsequent option or choice completions.
2. A mailman completion regenerate command that generates a fresh
static script including current plugin commands, which users run once
after installing or removing a plugin. This gives zero latency but
requires a manual step to stay current.

Which approach is preferred?

Thanks
Sambodhi


On Wed, Mar 18, 2026 at 9:03 PM Stephen J. Turnbull <[email protected]> wrote:
>
> Sambodhi Roy via Mailman-Developers writes:
>  > A few follow-up questions:
>  > 1. Regarding plugins, static scripts won't know about commands added
>  > via ICLISubCommand. Should I handle this, or is it out of scope?
>
> Yes, dynamically adding completion at least for the subcommand name is
> important, otherwise overlapping prefixes will make it appear that the
> dynamically installed subcommand isn't present.
>
>  > 2. Regarding mailmanweb, I ran mailman-web help and I think it's
>  > Django's command system underneath, and Django has built-in tab
>  > completion. Should I document the existing completion for that rather
>  > than implementing anything new?
>
> Yes.  I would expect that that Django people have a good
> implementation that picks up extensions and maybe their
> options/arguments automatically.
>
>  > 3. Using mailman completion on, does this permanently install
>  > completions or just activate them for the current session?
>
> Just activate.  I'd expect that installing mailman would install the
> completions, by default they would be enabled, and the more normal
> case would be the occasional user who wants them off for some reason.
>
> Steve
>
> --
> GNU Mailman consultant (installation, migration, customization)
> Sirius Open Source    https://www.siriusopensource.com/
> Software systems consulting in Europe, North America, and Japan
_______________________________________________
Mailman-Developers mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9

Reply via email to