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

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

Sven Wischnowsky wrote:
>So, if we are expecting to implement associative arrays with some
>really powerful mechanisms (think about the pattern matching stuff
>completion will/should support),

*double take*

Hmm, I didn't consider the pattern matching aspect when I suggested using
associative arrays.  But since the existing hashtable code provides an
interface for pattern matching lookups, it shouldn't be difficult to
provide a user interface.

>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".)


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