From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9097 invoked from network); 9 Sep 1999 09:14:32 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Sep 1999 09:14:32 -0000 Received: (qmail 17620 invoked by alias); 9 Sep 1999 09:14:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7736 Received: (qmail 17613 invoked from network); 9 Sep 1999 09:14:22 -0000 Date: Thu, 9 Sep 1999 11:14:17 +0200 (MET DST) Message-Id: <199909090914.LAA02499@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 09 Sep 1999 17:50:01 +0900 Subject: Re: PATCH: _cvs Tanaka Akira wrote: > Z(2):akr@is27e1u11% Src/zsh -f > is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst > is27e1u11% _tst () { compadd -J option -X option -y '(mno pqr)' ghi jkl; compadd -J option -X option abc def } > is27e1u11% tst > mno pqr > option > abc def > > This test case excahnges the order of two `compadd'. I think it's not > intentional. Yes, I just stumbled over this, too. The problem was just that the group named by the `-[JV]' wasn't created before the one for the `-y', so the explanation string showed up in the wrong place. > Also, I modified _apt_arguments not to use -y if it is un unnecessary. Yep, I've just done something similar for `_display'. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Thu Sep 9 11:04:39 1999 +++ Src/Zle/zle_tricky.c Thu Sep 9 11:07:58 1999 @@ -3951,16 +3951,21 @@ } else dat->prpre = dupstring(dat->prpre); /* Select the group in which to store the matches. */ - if (dat->group || dat->ylist) { + if (dat->group) { endcmgroup(NULL); - begcmgroup((dat->ylist ? NULL : dat->group), - (dat->aflags & CAF_NOSORT)); + begcmgroup(dat->group, (dat->aflags & CAF_NOSORT)); if (dat->aflags & CAF_NOSORT) mgroup->flags |= CGF_NOSORT; } else { endcmgroup(NULL); begcmgroup("default", 0); } + if (dat->ylist) { + endcmgroup(NULL); + begcmgroup(NULL, (dat->aflags & CAF_NOSORT)); + if (dat->aflags & CAF_NOSORT) + mgroup->flags |= CGF_NOSORT; + } /* Select the set of matches. */ oisalt = (dat->aflags & CAF_ALT); @@ -5944,9 +5949,13 @@ curcc = cc; mflags = 0; - if (cc->ylist || cc->gname) { + if (cc->gname) { + endcmgroup(NULL); + begcmgroup(cc->gname, cc->mask2 & CC_NOSORT); + } + if (cc->ylist) { endcmgroup(NULL); - begcmgroup((cc->ylist ? NULL : cc->gname), cc->mask2 & CC_NOSORT); + begcmgroup(NULL, cc->mask2 & CC_NOSORT); } if (cc->mask & CC_REMOVE) mflags |= CMF_REMOVE; --- oldcompletion/Core/_display Wed Sep 8 16:19:38 1999 +++ Completion/Core/_display Thu Sep 9 11:11:56 1999 @@ -39,7 +39,7 @@ # descriptions. _simple=() - _len=1 + _len=-1 for _i in "$_arr[@]"; do _tmp="${#_i%%:*}" if [[ "$_i" = *:?* ]]; then @@ -48,6 +48,11 @@ _simple=( "$_simple[@]" "${_i%:}" ) fi done + + if [[ _len -lt 0 ]]; then + eval "${_param}=''" + return 1 + fi # Now we build the list in `_tmp', adding one line per string. -- Sven Wischnowsky wischnow@informatik.hu-berlin.de