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

Re: Fun with new completion



Andrej Borsenkow wrote:

> bor@itsrm2:~%> vared pat
> pat    path
> 
> In other words, vared tried to complete the name of local variable, that is
> defined in completion function :-) pat is not defined otherwise.
> 
> And it just occured to me, that the same could happen in e.g. [un]setopt. As
> I understand, they do it by listing currently set/unset options ... with the
> result, that if options are changed in some top level function, they will
> list wrong options ...

I was aware of the problem with parameter names, but hadn't thought
about the options.

Maybe we should rename the local parameters (where needed) to `_...',
modify the function `_vars' to show  only parameters without a leading 
underscore and be callable from everywhere.
For the options I can only see the solution to make `_main_complete'
save the original set and unset options in arrays and then add two
functions to complete from these arrays (this is currently only used
for `setopt' and `unsetopt', but to make this cleanly...).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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