From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25186 invoked from network); 7 Aug 2004 13:43:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Aug 2004 13:43:10 -0000 Received: (qmail 97403 invoked from network); 7 Aug 2004 13:43:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Aug 2004 13:43:04 -0000 Received: (qmail 24463 invoked by alias); 7 Aug 2004 13:42:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20235 Received: (qmail 24453 invoked from network); 7 Aug 2004 13:42:51 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 7 Aug 2004 13:42:51 -0000 Received: (qmail 96722 invoked from network); 7 Aug 2004 13:40:53 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 7 Aug 2004 13:40:50 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-3.tower-36.messagelabs.com!1091886048!8290513 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 7493 invoked from network); 7 Aug 2004 13:40:48 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-3.tower-36.messagelabs.com with SMTP; 7 Aug 2004 13:40:48 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i77Demf6018963; Sat, 7 Aug 2004 14:40:48 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id C7E9C791B004; Sat, 7 Aug 2004 15:40:03 +0200 (CEST) Cc: 261775@bugs.debian.org X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040806180339.GA31854@scowler.net> From: Oliver Kiddle References: <200408061350.i76DovBi028948@news01.csr.com> <20040806180339.GA31854@scowler.net> To: Zsh Subject: Re: zsh 4.2.1-test-A Date: Sat, 07 Aug 2004 15:40:03 +0200 Message-ID: <10094.1091886003@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Clint wrote: > Here's some that still seem to affect 4.2.1-test-A. > > #258431 - doesn't complete .iso files for cdrecord. I can't reproduce this with 4.2.1-test-A so I suspect there is something that fixed it which isn't in Debian's 4.2.0. Note that we probably shouldn't add -g \*.iso to _files. There are many other file extensions (and filesystems besides iso9660) relevant to CD (and DVD) images. > #261775 - remote rsync completion needs escaping a la scp completion I ripped the remote file completion out of _ssh and stuck it in. Patch is below. Hopefully that doesn't break anything. We probably ought to factor _remote_files out into a separate function given that all of _ssh, _rsh and _rsync contain near identical code. > #256789 - brace completion commas aren't escaped (17791, 17913, 17926) I wouldn't want to attempt to fix that just before a release. Would be too easy to break something. Oliver Index: Completion/Unix/Command/_rsync =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rsync,v retrieving revision 1.9 diff -u -r1.9 _rsync --- Completion/Unix/Command/_rsync 14 Apr 2004 14:54:16 -0000 1.9 +++ Completion/Unix/Command/_rsync 7 Aug 2004 13:18:14 -0000 @@ -1,12 +1,9 @@ #compdef rsync _rsync_remote_files() { -local suf tag=accounts +local expl remfiles remdispf remdispd remmodules suf ret=1 tag=accounts -if [[ -prefix *::*/ ]]; then - local remfiles remdispf remdispd - - compset -P '*::*/' +if compset -P '*::*/'; then remfiles=(${(f)"$(_call_program files rsync ${words[CURRENT]%/*}/)"}) @@ -19,10 +16,7 @@ _wanted files expl 'remote file or directory' \ compadd -S/ -d remdispd ${remdispd##* } -elif [[ -prefix 1 *:: ]]; then - local remfiles remmodules - - compset -P 1 '*::' +elif compset -P 1 '*::'; then remfiles=(${(f)"$(_call_program files rsync ${words[CURRENT]%::*}::)"}) @@ -30,32 +24,33 @@ _describe "remote modules" remmodules -S/ -elif [[ -prefix 1 *: ]]; then - local remfiles remdispf remdispd slash +elif compset -P 1 '*:'; then - compset -P 1 '*:' - - if zstyle -T ":completion:${curcontext}:" remote-access; then - slash=/ - remfiles=(${(f)"$(_call_program files ssh -a -x ${words[CURRENT]%:*} ls -d1FL "${${${words[CURRENT -]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null")"}) + if zstyle -T ":completion:${curcontext}:files" remote-access; then + remfiles=(${(M)${(f)"$(_call_program files ssh -a -x ${IPREFIX%:} ls -d1FL "${(Q)PREFIX%%[^./][^/]#}\*" 2>/dev/null)"}%%[^/]#(|/)}) + compset -P '*/' + compset -S '/*' || suf='remote file' remdispf=(${remfiles:#*/}) remdispd=(${(M)remfiles:#*/}) - _wanted files expl 'remote file or directory' \ - compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/} - - _wanted files expl 'remote file or directory' \ - compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/} + _tags files + while _tags; do + while _next_label files expl ${suf:-remote directory}; do + [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \ + ${(q)remdispf%[*=@|]} && ret=0 + compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \ + ${(q)remdispd%/} && ret=0 + done + (( ret )) || return 0 + done else - _message -e remote-files 'remote files' + _message -e remote-files 'remote file' fi -elif [[ -prefix 1 *@ ]]; then +elif compset -P 1 '*@'; then local user=${PREFIX%%@*} - compset -P 1 '*@' compset -S ':*' || suf=":" _wanted -C user-at hosts expl "host for $user" \