From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24771 invoked from network); 22 Nov 2006 22:22:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Nov 2006 22:22:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 39277 invoked from network); 22 Nov 2006 22:22:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 22:22:33 -0000 Received: (qmail 21620 invoked by alias); 22 Nov 2006 22:22:26 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11018 Received: (qmail 21610 invoked from network); 22 Nov 2006 22:22:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Nov 2006 22:22:25 -0000 Received: (qmail 38159 invoked from network); 22 Nov 2006 22:22:25 -0000 Received: from wx-out-0506.google.com (66.249.82.238) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 22:22:22 -0000 Received: by wx-out-0506.google.com with SMTP id i31so345055wxd for ; Wed, 22 Nov 2006 14:22:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=KD3Zv3QC00zLEz875CiIJcR6rOoUCNWl73WeTHtWNBOmQzmqkjMymiALqTv6rLrW3OjryYore53CUDlFOQJg335uSXvwQi4Jf0VhItBqbAdIa/GldliwoCHPztv3LsjTQopI7999qk4Nl15xYDng1Whsd8GffKeAEzSzuLwU7Ls= Received: by 10.90.119.15 with SMTP id r15mr7256753agc.1164234139858; Wed, 22 Nov 2006 14:22:19 -0800 (PST) Received: by 10.90.65.18 with HTTP; Wed, 22 Nov 2006 14:22:19 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2006 23:22:19 +0100 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Bart Schaefer" Subject: Re: Problem with _arguments Cc: "zsh-users@sunsite.dk" In-Reply-To: <061122075510.ZM12028@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200611212342.kALNg9m7006648@pwslaptop.csr.com> <200611221039.kAMAdpal021905@news01.csr.com> <061122075510.ZM12028@torch.brasslantern.com> X-Google-Sender-Auth: 96b2e658afa8ebf3 On 11/22/06, Bart Schaefer wrote: > On Nov 22, 10:39am, Peter Stephenson wrote: > } > } parsing yourself or running _arguments twice. You can edit words (the > } command line) and CURRENT (the index into it), plus it's also possible > } in some contexts to tell _arguments to limit the words visible in the > } completion that it's calling by the use of enough colons. I find > } directly manipulating words and CURRENT less infuriating. > > Don't forget about compset: > > -n BEGIN [ END ] > If the current word position as specified by the parameter > CURRENT is greater than or equal to BEGIN, anything up to the > BEGIN'th word is removed from the words array and the value > of the parameter CURRENT is decremented by BEGIN. > > If the optional END is given, the modification is done only if > the current word position is also less than or equal to END. > In this case, the words from position END onwards are also > removed from the words array. > > Both BEGIN and END may be negative to count backwards from > the last element of the words array. > > -N BEG-PAT [ END-PAT ] > If one of the elements of the words array before the one at > the index given by the value of the parameter CURRENT matches > the pattern BEG-PAT, all elements up to and including the > matching one are removed from the words array and the value > of CURRENT is changed to point to the same word in the > changed array. > > If the optional pattern END-PAT is also given, and there is an > element in the words array matching this pattern, the > parameters are modified only if the index of this word is > higher than the one given by the CURRENT parameter (so that > the matching word has to be after the cursor). In this case, > the words starting with the one matching end-pat are also > removed from the words array. If words contains no word > matching END-PAT, the testing and modification is performed > as if it were not given. > > So it should work to do something like > > compset -N '[^-]*' The problem with this is that it removes arguments to options, that is, it'll remove, as I understand it, the 1 to -maxdepth "find src -maxdepth 1" causing all sorts of confusion for the _arguments function and it won't complete anything after it any more. nikolai