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

Re: completion test suggestion



I wrote:

> To make this more friendly to the eye, we could also keep the
> condition codes and make them non-modifying:
> 
>     if [[ -between s1 s2 ]]; then
>       words=("${(@)words[rangebeg(s1,s2),rangeend(s1,s2)]}")
> 
> and so on.

After thinking more about this: for this example the test
`(( -rangebeg(s1,s2) ))' should already be enough. For other tests we
could just add some helpful functions, e.g. `prefix(s1,s2)' which
returns the length of the common prefix of both strings and so
on. Such functions may be helpful in writing shell functions that do
matching anyway and with a good set of such functions we could put all 
tests together in one `(( ... ))'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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