Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion for darcs



On 24 Sep, Wayne Davison wrote:
> I've made some simple changes to the zsh-completion example that
> ships with darcs (the version control system) and checked it into
> the Completion/Unix/Command dir.  It seems to work well in my
> testing so far.  I've attached the file to this email as well.

This doesn't complete filenames at all. Is that always right for darcs?
As the recent point on zsh-users about completion after "svn import"
highlights, it is quite annoying when filename completion is broken.

It very clearly looks like someone has converted this from a bash
function. You can specify that a bash function should revert to filename
completion if no matches are added with a "-o default" or "-o
bashdefault" option to complete. That's outside the function and a bit
hidden so we need to be careful about functions converted from bash. 

We also don't need to grep for $PREFIX: matching is done far better
internally. Even in bash, that's not the right way to do it (use compgen
-W and pass the prefix as a final argument). We also don't need the
_darcs() { ... } stuff and the compadds should go through _wanted (the
second perhaps through _arguments). Return statements are also wrong.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author