From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4257 invoked from network); 1 Sep 1999 12:24:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Sep 1999 12:24:18 -0000 Received: (qmail 17506 invoked by alias); 1 Sep 1999 12:24:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7607 Received: (qmail 17499 invoked from network); 1 Sep 1999 12:24:10 -0000 Date: Wed, 1 Sep 1999 14:23:59 +0200 (MET DST) Message-Id: <199909011223.OAA00678@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 01 Sep 1999 21:01:34 +0900 Subject: Re: PATCH: Completion/Cvs/ Tanaka Akira wrote: > is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst > is27e1u11% compconf group_matches=yes > is27e1u11% compconf message_format='%d' > is27e1u11% compconf description_format='%d' > is27e1u11% _tst () { _arguments '-e+:editor:(vi)' '*::mesg:false' } > is27e1u11% tst -e > > This should complete `vi', but does not. > > is27e1u11% cvs > add commit export log release tag watchers > admin diff history login remove unedit > annotate edit import logout rtag update > checkout editors init rdiff status watch > > Also, this should complete cvs common options addition to cvs commands. Damn, I'm getting a bit confused... > Reverting the hunk fix this problem. Is this correct? No, that would make `tst a -e' complete to `vi' again. The patch below adds a flag that says if we left the command line parsing because we found a non-option and we have `*::..'. Whew, I hope this gets everything right this time ;-) Bye Sven diff -u oc/Base/_arguments Completion/Base/_arguments --- oc/Base/_arguments Wed Sep 1 13:04:49 1999 +++ Completion/Base/_arguments Wed Sep 1 14:19:38 1999 @@ -7,7 +7,7 @@ local args rest ws cur nth def nm expl descr action opt arg tmp local single uns ret=1 soptseq soptseq1 sopts prefix line -local beg optbeg argbeg nargbeg inopt fromrest +local beg optbeg argbeg nargbeg inopt inrest fromrest # Associative arrays used to collect information about the options. @@ -500,7 +500,10 @@ line=( "$line[@]" "$ws[1]" ) [[ -n "$inopt" ]] && nargbeg=$(( beg - 1 )) inopt='' - [[ -z "$args[nth]" && "$rest" = \*::* ]] && break + if [[ -z "$args[nth]" && "$rest" = \*::* ]]; then + inrest=yes + break + fi (( nth++ )) fi fi @@ -537,7 +540,7 @@ optbeg="$nargbeg" argbeg="$nargbeg" fromrest=yes - [[ "$def" = \*::* ]] && opt='' + [[ -n "$inrest" ]] && opt='' fi fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de