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

Re: default tag-order (was Re: zsh 4.2.1-test-A)



You wrote:

> I'm confused by this suggestion.  If there's no options tag, the tag-order 
> doesn't make any difference, because it's in the second group of tags.  
> And in the case of cdrecord, there _is_ an options tag.  How would that
> proposed change help?

Well the options aren't completed in the same tag loop so it doesn't
affect _cdrecord. _arguments just doesn't get used that way. Checking
for the other tags ((|*-)argument-* (|*-)option[-+]* or values) doesn't
particularly help given that there is only a problem when they (or
values to be precise) are there.

> > Default tag-orders really need thinking about in general. It'd be nice
> > to be able to specify them from completion functions themself.
> 
> Why is that not possible?  For example, several completion functions set 
> the cache-policy style if it's not already set.

Doing it that way is ugly. And not just because the function has to
lookup the style before setting it. It just seems wrong to me for
completion functions to set styles. There's quite a lot of places where
default tag orders would be useful so it would potentially clutter the
style list. For all other styles, we don't set the style to achieve a
default so why should we make an exception for tag-order. It is also the
case that a certain zstyle context will apply to more than one tag loop
so you can't always give them different defaults.

I think the cache-policy stuff would be far better handled by guarding
the policy functions with (( $+functions[_foo_caching_policy] )) ||
I don't see why they should have a style when anything else you want to
override is just done by having a replacement function. Judging by
20211, the cache stuff isn't used much anyway.

Oliver



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