From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22876 invoked from network); 22 Jun 1999 13:32:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Jun 1999 13:32:13 -0000 Received: (qmail 27066 invoked by alias); 22 Jun 1999 13:31:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6786 Received: (qmail 27059 invoked from network); 22 Jun 1999 13:31:49 -0000 Date: Tue, 22 Jun 1999 15:31:15 +0200 (MET DST) Message-Id: <199906221331.PAA03789@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk CC: greg@klanderman.net (Greg Klanderman) In-reply-to: greg@klanderman.net's message of Tue, 22 Jun 1999 09:21:47 -0400 (EDT) Subject: Re: extended compctl bug in 3.1.5 Greg Klanderman wrote: > Hi, > > I hope this example will illustrate two bugs in using the "R" pattern > in extended completion: > > compctl -k '(foo bar)' -x 'R[bar,foo]' -k '(a b c)' \ > - 'R[foo,;]' -k '(1 2 3)' -- foobar > > First, type "foobar foo", with no space after "foo" and hit TAB. You > get a beep and no completions, because the 'R[foo,;]' clause is > matching even though you are not after but ON the word with prefix > 'foo'. I would expect it to complete "foo" by appending the suffix > space. Yes, we should probably avoid this. > Second, type "foobar foo bar ", with a space after "bar". Hit TAB and > you get the completions "a", "b", and "c", which you should not, as > you are not before "foo". This, however is intentional -- think about cases where you want to have multiple groups of `foo ... bar'. But the manual could be clearer... I don't know if you can apply this patch to an unmodified 3.1.5. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Tue Jun 22 11:51:29 1999 +++ Src/Zle/zle_tricky.c Tue Jun 22 15:24:27 1999 @@ -5631,7 +5631,7 @@ case CCT_RANGEPAT: if (cc->type == CCT_RANGEPAT) tokenize(sc = dupstring(cc->u.l.a[i])); - for (j = clwpos; j; j--) { + for (j = clwpos - 1; j > 0; j--) { untokenize(s = ztrdup(clwords[j])); if (cc->type == CCT_RANGESTR) sc = rembslash(cc->u.l.a[i]); diff -u od/Zsh/compctl.yo Doc/Zsh/compctl.yo --- od/Zsh/compctl.yo Tue Jun 22 11:51:38 1999 +++ Doc/Zsh/compctl.yo Tue Jun 22 15:26:22 1999 @@ -633,7 +633,8 @@ ) item(tt(r[)var(str1)tt(,)var(str2)tt(])...)( Matches if the cursor is after a word with prefix var(str1). If there -is also a word with prefix var(str2) on the command line it matches +is also a word with prefix var(str2) on the command line after the one +matched by var(str1) it matches only if the cursor is before this word. If the comma and var(str2) are omitted, it matches if the cursor is after a word with prefix var(str1). ) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de