From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11994 invoked from network); 24 Nov 2006 20:56:51 -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; 24 Nov 2006 20:56:51 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 57827 invoked from network); 24 Nov 2006 20:56:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Nov 2006 20:56:44 -0000 Received: (qmail 14550 invoked by alias); 24 Nov 2006 20:56:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11030 Received: (qmail 14541 invoked from network); 24 Nov 2006 20:56:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Nov 2006 20:56:35 -0000 Received: (qmail 56678 invoked from network); 24 Nov 2006 20:56:35 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 24 Nov 2006 20:56:31 -0000 Received: from torch.brasslantern.com ([71.116.86.88]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0J9900IEH65YMK83@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 24 Nov 2006 14:56:23 -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 kAOKuLN0014977 for ; Fri, 24 Nov 2006 12:56:22 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id kAOKuLjQ014976 for zsh-users@sunsite.dk; Fri, 24 Nov 2006 12:56:21 -0800 Date: Fri, 24 Nov 2006 12:56:21 -0800 From: Bart Schaefer Subject: Re: Problem with _arguments In-reply-to: To: "zsh-users@sunsite.dk" Message-id: <061124125621.ZM14975@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> <061122075510.ZM12028@torch.brasslantern.com> Comments: In reply to "Nikolai Weibull" "Re: Problem with _arguments" (Nov 22, 2:22pm) On Nov 22, 2:22pm, Nikolai Weibull wrote: } } > Don't forget about compset: } > } > -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 ... } > } > 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 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. Actually in that case it should remove everything up to and including the "1" so the completion should behave as if there is nothing on the command line except the command word and the leading part of the word containing the cursor (assuming it is to the right of the "1") -- plus anything to the right of the cursor, of course. As your real usage is considerably more complex than the example you gave, that's probaby not what you want, but it's also not what you understood.