From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 856 invoked from network); 22 Nov 2006 15:56:07 -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.5 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 15:56:07 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 20527 invoked from network); 22 Nov 2006 15:55:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 15:55:49 -0000 Received: (qmail 23939 invoked by alias); 22 Nov 2006 15:55:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11016 Received: (qmail 23929 invoked from network); 22 Nov 2006 15:55:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Nov 2006 15:55:39 -0000 Received: (qmail 19435 invoked from network); 22 Nov 2006 15:55:39 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 15:55:36 -0000 Received: from torch.brasslantern.com ([71.116.86.88]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0J950002D2VZ7OJ4@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Wed, 22 Nov 2006 09:55:12 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id kAMFtAhZ012030 for ; Wed, 22 Nov 2006 07:55:11 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id kAMFtANf012029 for zsh-users@sunsite.dk; Wed, 22 Nov 2006 07:55:10 -0800 Date: Wed, 22 Nov 2006 07:55:10 -0800 From: Bart Schaefer Subject: Re: Problem with _arguments In-reply-to: <200611221039.kAMAdpal021905@news01.csr.com> To: "zsh-users@sunsite.dk" Message-id: <061122075510.ZM12028@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200611212342.kALNg9m7006648@pwslaptop.csr.com> <200611221039.kAMAdpal021905@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Problem with _arguments" (Nov 22, 10:39am) 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 '[^-]*' before calling _arguments.