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

Re: Exporting arrays

Mirar (mirar@xxxxxxxxx) wrote:
> > Is that glob patterns also, or something else?  I ask, because I
> > can't get it working.  I want a condition like C[0,abcd????]
> I got this line to work, at least:
> compctl -k '(foobar)' -x C[-1,foo???] -k '(foo bar)' - -- foo 

That provided enough of a clue for me to realise what I was
doing wrong :-)

Essentially I wanted it to add a suffix if the prefix matched
foo???? but had forgotten that the prefix was counted as part of
the completion and so any valid completions would have to
begin with this prefix.  Hence I needed a dummy completion which
always completed successfully by adding an empty string, and
found one in -K compctl_dummy, where

compctl_dummy () {

Is there a better way of doing this?  Should there not be the
flexibility of choosing whether or not a specified string or
pattern to match is part of the completion?

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