From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22747 invoked from network); 6 Dec 1999 09:28:46 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Dec 1999 09:28:46 -0000 Received: (qmail 17414 invoked by alias); 6 Dec 1999 09:28:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8906 Received: (qmail 17407 invoked from network); 6 Dec 1999 09:28:33 -0000 Date: Mon, 6 Dec 1999 10:28:32 +0100 (MET) Message-Id: <199912060928.KAA05344@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Fri, 03 Dec 1999 20:41:31 +0000 Subject: Re: _path_files -W change Peter Stephenson wrote: > This used to work. Has it officially stopped? MH folder completion > currently won't work because of it. That can be trivially changed if the > new behaviour is correct. > > foopath=~/Mail > compdef _foo foo > foo() { _path_files -W foopath -/ } > foo > > used to expand $foopath and complete directories, now doesn't. It got confused because there wasn't a trailing slash. This patch should make this as convenient as possible, i.e. the -W paths may or may not have a trailing slash. Bye Sven diff -u -r oldcompletion/Core/_path_files Completion/Core/_path_files --- oldcompletion/Core/_path_files Fri Dec 3 16:42:42 1999 +++ Completion/Core/_path_files Mon Dec 6 10:26:28 1999 @@ -39,10 +39,10 @@ ;; W) tmp1="$OPTARG" if [[ "$tmp1[1]" = '(' ]]; then - prepaths=( ${^=tmp1[2,-2]}/ ) + prepaths=( ${^=tmp1[2,-2]%/}/ ) else - prepaths=( ${(P)=${tmp1}} ) - (( ! $#prepaths )) && prepaths=( ${tmp1}/ ) + prepaths=( ${(P)^=tmp1%/}/ ) + (( ! $#prepaths )) && prepaths=( ${tmp1%/}/ ) fi (( ! $#prepaths )) && prepaths=( '' ) ;; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de