From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10587 invoked from network); 4 Aug 2009 08:51:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 4 Aug 2009 08:51:26 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 75411 invoked from network); 4 Aug 2009 08:51:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Aug 2009 08:51:16 -0000 Received: (qmail 23727 invoked by alias); 4 Aug 2009 08:51:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27206 Received: (qmail 23705 invoked from network); 4 Aug 2009 08:51:09 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 4 Aug 2009 08:51:09 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 6855C810A3BE for ; Tue, 4 Aug 2009 10:51:05 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly24d.srv.mailcontrol.com (MailControl) with ESMTP id n748p1Tc004068 for ; Tue, 4 Aug 2009 09:51:01 +0100 Received: from news01.csr.com ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 4 Aug 2009 09:51:00 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id n748oxBp011866 for ; Tue, 4 Aug 2009 09:50:59 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id n748oxlc011862 for ; Tue, 4 Aug 2009 09:50:59 +0100 Message-Id: <200908040850.n748oxlc011862@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers Subject: Re: Quoting problems with _zip (unzip) completer In-reply-to: <237967ef0908031315u72fa3661i17ff7f0107b85b9c@mail.gmail.com> References: <237967ef0908031315u72fa3661i17ff7f0107b85b9c@mail.gmail.com> Comments: In-reply-to Mikael Magnusson message dated "Mon, 03 Aug 2009 22:15:37 +0200." Date: Tue, 04 Aug 2009 09:50:59 +0100 From: Peter Stephenson X-OriginalArrivalTime: 04 Aug 2009 08:51:00.0241 (UTC) FILETIME=[B0A67810:01CA14E0] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-09-20-00 (www.mailcontrol.com) on 10.68.0.134 X-Virus-Scanned: ClamAV 0.94.2/9650/Tue Aug 4 05:42:34 2009 on bifrost X-Virus-Status: Clean Mikael Magnusson wrote: > % unzip test\[.zip > _zip:117: bad pattern: test[.zip(|.zip|.ZIP) > _zip:117: bad pattern: test[.zip(|.zip|.ZIP) > _zip:117: bad pattern: test[.zip(|.zip|.ZIP) > >.. > @@ -114,7 +114,7 @@ case $state in > if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then > _wanted files expl zfile _files -g > '^(#i)*.(zip|xpi|[ejw]ar)(-.)' && return > else > - zipfile=( $~line[1](|.zip|.ZIP) ) > + zipfile=( $line[1](|.zip|.ZIP) ) > [[ -z $zipfile[1] ]] && return 1 > if [[ $zipfile[1] != $_zip_cache_list ]]; then > _zip_cache_name="$zipfile[1]" The trouble is this stops you using filenames with a ~, among other things. This suggests the value of "line" is a bit inconsistent. Sure enough if I use ~/tmp/zip/tmp\[.zip $line[1] comes back (using print -r) as ~/tmp/zip/test[.zip which is wrong---either the ~ needs to be expanded, or the [ needs to be quoted. So this needs tracking internally, unfortunately. If it hits the internal completion quoting system we're probably stuck---I spent weeks looking at that a couple of years ago and got virtually nowhere. However, it may not be that bad in this case. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK 'member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom'