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

Bad interaction between -iprefix and -string



I'm gradually working through my compctl's; I'll try and make the
result, including autodefcomping of functions and rebinding of
completion widgets etc., available when it looks presentable.

This came out of my attempts to handle dd, but here's a simpler test.
The [[ ... ]] stuck on its own looks funny, but it relies on the side
effect on IPREFIX.

% defcomp stest
% which __stest
__stest () {
        if [[ -iprefix name= ]]
        then
                [[ -string , ]]
                complist -k '(yan tan tethera dick)'
        fi
}
% stest name=y<TAB>                # produces...
% stest name=yan                   # OK so far, add `,te' by hand...
% stest name=yan,te<TAB>           # produces...
% stest name=yan,tedick            # The te is being ignored, too.

I checked and the corresponding compctl:

% compctl -x 's[name=] n[-1,,],s[name=]' -k '(yan tan tethera dick)' -- stest

works OK.


While I'm here, another comment on compadd: it's a well-known fact
that it doesn't check whether what you are adding actually matches
what's on the command line.  Is it easy to get it to do the check
unless the -U option is given?  It would be a little neater than
having to call complist with -s for a list produced by $(...) if you
don't want to postprocess the list.  In fact, what effect does -U have
on compadd at the moment, given that the existing prefix is deleted
with or without it?

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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