Many bash completions call 'compopt -f' or 'compopt -d' inside $() instead of _filedir, and that means that they don't work with filenames/dirnames that contain spaces.
I reported one instance:
But then I discovered that there are a lot of completions that do this.
* fgrep 'compgen -f' /etc/bash_completion.d/*
* fgrep 'compgen -d' /etc/bash_completion.d/*
To get an idea of how many completions have this problem.
should be used instead.
Please file new bug reports for any bashcomp files that need fixing so that each bug can be assigned to the packages' respective maintainers. Make all those bugs block this one.
Also, please respect the quiet of this tracker bug unless talk is about the tracker itself.