From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12220 invoked from network); 3 Aug 2009 20:15:50 -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.6 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; 3 Aug 2009 20:15:50 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 70458 invoked from network); 3 Aug 2009 20:15:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Aug 2009 20:15:47 -0000 Received: (qmail 9047 invoked by alias); 3 Aug 2009 20:15:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27205 Received: (qmail 9020 invoked from network); 3 Aug 2009 20:15:41 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 3 Aug 2009 20:15:41 -0000 Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by bifrost.dotsrc.org (Postfix) with ESMTP id 186D180F77DD for ; Mon, 3 Aug 2009 22:15:38 +0200 (CEST) Received: by ewy5 with SMTP id 5so3230517ewy.39 for ; Mon, 03 Aug 2009 13:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=UdVwCXlMBU1QZd/KtCdm1hVQP+MOAauwzLABrWihztc=; b=jPpvkgOI03LRLU3vJR6oM3DsHY74FT6C1hdAu/qqp3dO52w+PRnY/ua7D6OqMwGY5n hFbZvYfuzizoU2dwadEuH3pRCqKNYHs0Btm6hLXnTegFHDRn+Dj8ANhDuwNB/FSg7/D1 oZ8hMqqqkbA8xpCH+8MsHySI8YKEupSSfWJbs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=DZzebM/k05XBE8vgvgueWmRxovQsLthffrsqEY6sFTRnUVAVwKp7NvVc8MQL0PyW27 fS0XhxHx04l25iv1NIv1YNY1Yd5QWVOLzMDJlnAwaREA1vT0RjngbWxT8XpuNMOKlG48 0ZAuj9l5DR/zhZzmsCM5WIdsyxpJtlbtG/kJU= MIME-Version: 1.0 Received: by 10.210.129.20 with SMTP id b20mr5587834ebd.83.1249330537758; Mon, 03 Aug 2009 13:15:37 -0700 (PDT) Date: Mon, 3 Aug 2009 22:15:37 +0200 Message-ID: <237967ef0908031315u72fa3661i17ff7f0107b85b9c@mail.gmail.com> Subject: Quoting problems with _zip (unzip) completer From: Mikael Magnusson To: zsh-workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9648/Mon Aug 3 15:27:08 2009 on bifrost X-Virus-Status: Clean Completing contents of zip files with metachars doesn't work, completing actual files in a zip file that you have renamed also doesn't work properly. These issues seem to be separate, but I could be wrong. While hacking around in _zip it seems like I "fixed" at least the first thing. The most obvious example is: % touch a b c % zip test.zip a b c % unzip test.zip a % mv test.zip test\[.zip % 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) naming the file test[].zip which is a valid pattern simply doesn't give any matches. Naming the files inside the zip file and calling it test.zip fails in various ways, sometimes it just completes the last file without giving a list, even though set -x shows the full file list being passed to the completion system, and typing a partial name + tab completes that file. Mysterious. The change I did that seems to solve the actual .zip file name issue is: @@ -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]" i.e. remove the ~. I didn't test if this breaks completion if you didn't type the ".zip" part of the filename. I've fiddled around adding (q) and quotes everywhere but it doesn't seem to improve matters any. -- Mikael Magnusson