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

Re: completion behaviour (was: zsh-workers: zsh-3.1.5 released)

Zefram wrote:

> ...
> >Partly agreed (see above), but I would still like to give the user
> >some more support. Think of `r[-exec,;]'. The user would have to do the
> >matching and before (s)he can produce matches (s)he would have to tell
> >the completion code which command words should not be used. This can
> >get a bit nasty.
> What you need there is for the user-defined completion function, after
> recognising the "-exec", to recursively invoke the completion mechanism
> on the restricted range of words.  As long as completion can be invoked
> recursively, there's no need for more specific support for this type
> of construct.  (Consider also how to properly handle completion of the
> word after "sh -c".)

Let's clear this once and for all. Currently the testing code produces 
two types of information: the length of an ignored prefix and a
possible range restriction in the command words. Without special
support, the user would have to do the test and then manually notify
the completion code of the restrictions to use (the prefix stuff for
almost all completions and the range restriction for `-l' which is
your example). In some cases this is trivial (e.g. for `S[-]'), in
some cases it is not that easy (e.g. `n[-1,/]' or `r[-exec,;]').
Personally I don't care if we would have to manually notify the
completion code, but I guess some users would like to have an easier
way. On the other hand, we could put examples for the most obvious
things in the manual.

Maybe I'll write an updated version of my suggestion in the next days.


Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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