From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16870 invoked from network); 11 Feb 1999 16:36:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Feb 1999 16:36:15 -0000 Received: (qmail 1158 invoked by alias); 11 Feb 1999 16:35:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5343 Received: (qmail 1151 invoked from network); 11 Feb 1999 16:35:23 -0000 Date: Thu, 11 Feb 1999 17:34:34 +0100 (MET) Message-Id: <199902111634.RAA06689@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Thu, 11 Feb 1999 16:41:32 +0100 (MET) Subject: Re: PATCH: Re: Bad interaction between -iprefix and -string I wrote: > Peter Stephenson wrote: > > > % stest name=y # produces... > > % stest name=yan # OK so far, add `,te' by hand... > > % stest name=yan,te # produces... > > % stest name=yan,tedick # The te is being ignored, too. > > Stuff like the above makes me think that even more control over the > inserted suffixes would be nice. In this case: make a `,' fall in > place automatically. That was nonsense, of course. This: __stest () { if [[ -iprefix name= ]] then [[ -string , ]] compadd -qr ',' -S ' ' -m yan tan tethera dick fi } should work perfectly well. But at least trying it revealed two bugs: with the `-m' option compadd should use IPREFIX and in addmatches() (which is the function used for compadd) we shouldn't tokenize the contents of the completion variables. With the patch below, it works. Bye Sven --- os/Zle/zle_tricky.c Mon Feb 8 13:18:36 1999 +++ Src/Zle/zle_tricky.c Thu Feb 11 17:31:46 1999 @@ -2489,16 +2489,15 @@ SWITCHHEAPS(compheap) { HEAPALLOC { if (aflags & CAF_MATCH) { - ctokenize(lipre = dupstring(compiprefix)); - remnulargs(lipre); - ctokenize(lpre = dupstring(compprefix)); - remnulargs(lpre); + lipre = dupstring(compiprefix); + lpre = dupstring(compprefix); llpl = strlen(lpre); - ctokenize(lsuf = dupstring(compsuffix)); - remnulargs(lsuf); + lsuf = dupstring(compsuffix); } if (ipre) ipre = (lipre ? dyncat(lipre, ipre) : dupstring(ipre)); + else if (lipre) + ipre = lipre; if (ppre) { ppre = dupstring(ppre); lpl = strlen(ppre); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de