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

Re: zsh-3.1.5-pws-5: mixing "old" and "new" completions?



Andrej Borsenkow wrote:

> 
> I would like to start play with new completion stuff. But I do not want to
> completely lose all current compctl's I have. What I would really like, is
> something like
> 
>   if defined new style completion
>      do it
>   else
>      use compctl completion
> 
> Is it possible?

I knew someone would ask for this...

No, currently I'm not sure how to do this. Providing a builtin
(`compold' or whatever) to generate the completions from a compctl
shouldn't be too hard. But if you have a definition for default
completion  in the new style stuff you probably want to use compctl's
only if there is one for the command (not -T, -D, ...). On the other
hand some people may want them to be used, or only sometimes, or...

Maybe we should instead provide a function that automatically converts
compctls into definitions for the new completion stuff. Transforming
them by hand as I did at the weekend is very tedious anyway.
But then again, the things in `new-completion-examples' are only
examples. One advantage of the new style is that you can almost
completely define the way completion is done by implementing your own
functions. So we could only write a function to convert to the style
used currently in `new-completion-examples', there is no way to write
a generic function for this. Also, the example stuff still isn't
complete, for example I currently use function return values as a
replacement for `-t', but not all functions do this correctly or
handle those return values.

But for those who only want to play with it: you can probably bind the 
new completion to a different key, keeping TAB for the compctl-stuff,
by changing the bindkey-argument in `new-completion-examples'.

Bye
 Sven

P.S.: Sorry.

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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