From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes Date: Wed, 27 Jan 1999 16:21:28 +0100 (MET) Message-Id: <199901271521.QAA31125@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Wed, 27 Jan 1999 18:04:32 +0300 Subject: RE: zsh-3.1.5-pws-5: mixing "old" and "new" completions? X-Mailing-List: 5065 Andrej Borsenkow wrote: > > `compcall' accepts no other option or argument, for now. It would > > be easy to make it accept arguments for the command line words to > > use, for the command name to use, etc. If this turns out to be > > interesting to have, I'll add it. > > I won't be able to test it for some time, but this occured to me today: > > compctl -T -K " __default" > > function __default() { > compcall -T > } Damn. Yesterday I thought about this, but today I forget to handle it. Since there is no easy way to correctly avoid recursions, let's use a depth counter (until we find a better solution, if we ever find a better solution). Bye Sven --- os/Zle/zle_tricky.c Wed Jan 27 16:16:32 1999 +++ Src/Zle/zle_tricky.c Wed Jan 27 16:18:58 1999 @@ -3449,10 +3449,21 @@ } SWITCHBACKHEAPS; } +/* A simple counter to avoid endless recursion between old and new style * + * completion. */ + +static int cdepth = 0; + +#define MAX_CDEPTH 16 + /**/ void makecomplistctl(int flags) { + if (cdepth == MAX_CDEPTH) + return; + + cdepth++; SWITCHHEAPS(compheap) { HEAPALLOC { int ooffs = offs, lip, lp; @@ -3488,6 +3499,7 @@ clwpos = op; } LASTALLOC; } SWITCHBACKHEAPS; + cdepth--; } /* This function gets the compctls for the given command line and * -- Sven Wischnowsky wischnow@informatik.hu-berlin.de