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

RE: Another slight weirdness



>
> By the way, I never liked the way _setopt and _unsetopt reflected the
> current state of the options, since usually I can't remember
> what's set and
> the fact I don't get offered all possibilities just confuses me.  The fact
> you now have to two $(...) calls on every single completion just to store
> the current values --- this does not seem to be the sort of thing
> completion should be doing by default --- makes me think even
> more strongly
> that this is just not worth it for the basic set-up and anyone
> sophisticated enough should add it themselves.

Anything more sophisticated will end up with just the same problem. O.K.,
what we have now:

 - top level shell has some options set
 - f1 is called - now we have global options and local f1 options
 - f2 is called from f1 - do we have three or two option sets now? That is,
if f1 has localoptions and changed some - will options upon exit from f2 be
restored to f1-local set or to global-set?

The latter smells like a bug. And if it is the former, that we have the
single global options set - and only need a way to acces it. And I really
suggest assoc array for that. That will make any work with options quite
easy (and actually un/setopt could be reduced to functions that simply set
array values :-)

Just tested - the options are restored to local f1 array. So, looks like it
is quite doable. And again, it will probably be quite useful outside of
completion as well.

cheers

/andrej



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