zsh-workers
 help / color / mirror / code / Atom feed
* Bad interaction between -iprefix and -string
@ 1999-02-11 14:12 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-02-11 14:12 UTC (permalink / raw)
  To: Zsh hackers list

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-02-11 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-11 14:12 Bad interaction between -iprefix and -string Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).