[Bash-completion-devel] Towards dynamic completion loading

Ville Skyttä ville.skytta at iki.fi
Tue Oct 18 20:40:42 UTC 2011


On 09/25/2011 10:07 PM, Ville Skyttä wrote:
> Hello,
> 
> Even though we don't have a roadmap item for dynamic completion loading
> (bash 4+'s complete -D), I'd like to start implementing it.

Okay, first cut of this is now done; I've just pushed a new branch
"dynamic-loading" containing this stuff to git.

Testsuite needs work, I haven't done anything to it.  It loads all
completions and proceeds to try to use them even if the needed commands
are not available, so there will be lots of failures.  Maybe we'd need
to go back to what it was before commit 79b9984 at least partially or
something like that.
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2010-February/002538.html
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2010-February/002556.html

Another thing that probably won't work as smoothly as it could is that
if one ends up loading and using a completion for a command that is not
installed, there might be some stderr spewage if executing that command
is attempted at completion time.  I think it's good enough if we fix
these as we find them (I'm not aware of anything at the moment, but then
again I haven't even looked).

Other than those known/suspected broken bits, it seems to work well for
me.  The boxes where I use bash-completion most have SSD disks nowadays
and for those the initial load time wasn't really an issue even before
this stuff, but it certainly doesn't hurt either.  On the other hand
I've done some artificial tests on other boxes with slower disks and the
improvement seems very promising.  I think loading completions on demand
is a winner.

Please give the branch a try and let the list know how it goes.



More information about the Bash-completion-devel mailing list