From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27362 invoked from network); 7 May 2001 15:12:24 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 May 2001 15:12:24 -0000 Received: (qmail 12796 invoked by alias); 7 May 2001 15:12:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14247 Received: (qmail 12744 invoked from network); 7 May 2001 15:12:01 -0000 From: "Bart Schaefer" Message-Id: <1010507150830.ZM27726@candle.brasslantern.com> Date: Mon, 7 May 2001 15:08:29 +0000 In-Reply-To: <200105070806.KAA01447@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Using _values with ->state transitions?" (May 7, 10:06am) References: <200105070806.KAA01447@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.dk Subject: Re: Using _values with ->state transitions? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 7, 10:06am, Sven Wischnowsky wrote: } Subject: Re: Using _values with ->state transitions? } } Bart Schaefer wrote: } } > This is supposed to work, isn't it? There appears to be code for it in } > _values, but there aren't any examples of it in the existing completion } > system. I can't get it to do anything sensible in several attempts. } } Hm, the simple test: } } _values test 'a:arg:->foo' b c } } if [[ -n $state ]]; then compadd foo bar; fi } } works for me. How does this fail for you? OK, that does work for me. However, it sometimes ignores the -s option. To wit: schaefer[505] _tv() { function> _values -s ':' test 'a:arg:->foo' b c function> if [[ -n $state ]]; then compadd $state; fi function> } schaefer[506] compdef _tv : schaefer[507] : a schaefer[507] : a= schaefer[508] : a=foo ^cursor here -- why did that space get added? I expected `a=foo:'. It would also be nice if there were a way to specify that something other than an `=' comes between the value and its argument. } > The zsh/computil documentation needs some improvement. } } I always think of computil as something too deeply hidden for ca. 99 } percent of all users and programmers. Well, then, it's the doc for _values that needs improvement. The SPECS for _values are no longer the same as those for _arguments (at best, they now are a subset). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net