From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27237 invoked from network); 30 Mar 2001 15:40:32 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Mar 2001 15:40:32 -0000 Received: (qmail 9553 invoked by alias); 30 Mar 2001 15:40:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13854 Received: (qmail 9540 invoked from network); 30 Mar 2001 15:40:25 -0000 From: "Bart Schaefer" Message-Id: <1010330153828.ZM4230@candle.brasslantern.com> Date: Fri, 30 Mar 2001 15:38:28 +0000 In-Reply-To: <20010330091639.88862.qmail@web9305.mail.yahoo.com> Comments: In reply to Oliver Kiddle "Re: Two missing completion functions that bug me" (Mar 30, 10:16am) References: <20010330091639.88862.qmail@web9305.mail.yahoo.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Two missing completion functions that bug me MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 30, 10:16am, Oliver Kiddle wrote: } Subject: Re: Two missing completion functions that bug me } } --- Bart Schaefer wrote: } } > You're right; upon another attempt, none of -c, -e, nor -h need the } > `+'. } } The plus says that the argument to the option can appear in the same or } subsequent word. Yes, but when you're allowed to have other options intervene between an option and its argument (as in `tar -fxv file' for example) there has to be some way to prevent completion from inserting the space after `-f'. In _rpm this is done by using both `+' and ->state so that options keep completing in the same word and only when there are none possible (or the next word is being completed) does the state machine get used to supply the argument. } The solution would be to use a state for the last (parameter) argument However, I didn't think this much effort was worthwhile for vared, as the number of options is small and they're not often used in combination except in script/function context. } and make it check $opt_args and select either _vars or _parameters } depending on this. I'm not sure whether it is worth it to do this } because -A and -a are only of any use if combined with -c so when } creating a new array which won't exist to be completed anyway. Not entirely true: `vared -ca scalar' changes the type of an existing scalar to an array, as if you'd done `scalar=($scalar)'. Same for -cA. } I got confused as to why the r variant of fc allows -l. So you can do `r -l FIRST [ LAST ]' for a listing. It's just for those too lazy to type a two-letter command name. If you don't use the -l, the commands from FIRST to LAST are actually *executed*. } What should it take? Anything that `fc' does, with the exception of `-e'. The -e option is ignored by fc and friends when -l is given so that you can have an alias for `fc -e jove' or whatever (which is all `r' really is) and still use the alias to get listings. } Are getln and pushln of any use interactively? I got confused trying to } alter _read and _print for them. I've never had occasion to use them interactively, but I could conjure a hypothetical scenario if pressed. } pwd and echo would be fairly doable if we ignore the possibility of } someone disabling them or using /bin/pwd. We really need a way to do `whence' to discover whether $service is a builtin or an external, without having to fork a process and parse its output. -- 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