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

Re: Redirection completion

Peter Stephenson wrote:

> ...
> It seems vaguely preferable to allow the user to omit trailing
> `,-default-' bits when defining commands (it's not important in style
> contexts since you would usually use a wildcard anyway), but it doesn't
> actually gain you anything apart from laxity.

That would only work if that would mean to omit the commas, too,
because I think the distinction between an empty field (no command on
the line) and -default- may sometime be good to have. I may be wrong,
of course.

> > I.e.:
> > should `-redirect-,-default-,echo' or `-redirect-,>,-default-' take
> > precedence?
> It seems more logical that the command variant should take precedence,
> although the order of the parts would imply otherwise.

Yes, that's the kind of philosophical question I was thinking about.
The whole style-context name is sorted least-to-most-specific.

Other comments?

> ...
> This seems OK unless we do something more complicated with pattern
> handling, e.g. some way of matching the point at which you want the
> pattern tried.  But I don't see any great call for that at the moment.

Nor do I, really...

Oliver on the same topic:

> Hmm, we might want to define -redirect-,<,-default- and would want
> patterns tried before that. I think the post-patterns should perhaps be
> tried just before -default- is first tried in the command position for
> redirection and in the parameter name position for values. Or perhaps,
> we need to look to see where each post-pattern uses -default-. If it
> uses a pattern for one part then we should use it before trying
> -default- for that part. We might need to require patterns to all be
> of the form -whatever-,pattern,pattern.

I think we should wait until we find something where we need a
different behaviour and then implement that (or the thing that solves
the problem behind the problem). We can add possibilities quite easily
because we already use the $_compskip parameter there (implementation
could be somewhat more complicated, depending on what we want).


Sven Wischnowsky                          wischnow@xxxxxxxxx

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