From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4138 invoked from network); 12 Oct 1999 07:16:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Oct 1999 07:16:43 -0000 Received: (qmail 5778 invoked by alias); 12 Oct 1999 07:16:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8215 Received: (qmail 5771 invoked from network); 12 Oct 1999 07:16:36 -0000 Date: Tue, 12 Oct 1999 09:16:35 +0200 (MET DST) Message-Id: <199910120716.JAA04048@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Vin Shelton's message of 23 Sep 1999 22:35:18 -0400 Subject: PATCH: Re: accept-and-menu-complete extra menu Vin Shelton wrote: > In pws-5 with (I think) all the patches applied, I'm seeing an extra > menu on accept-and-menu-complete with old-style completion. > > zsh -f > zion% bindkey '^X\t' accept-and-menu-complete > zion% setopt noalwayslastprompt > zion% echo $ZSH_ > ZSH_NAME ZSH_VERSION > > pressing another TAB gives me: > zion% echo $ZSH_NAME ; and then ^X-TAB yields: > zion% echo $ZSH_NAME $ZSH_VERSION > ZSH_NAME ZSH_VERSION > zion% echo $ZSH_NAME $ZSH_VERSION > > So, another menu appears when it shouldn't. > > This was working fine in plain old pws-5, I believe. It was. This was caused by an incomplete test in the code that makes sure that a-a-m-c with completion inside braces allows only those matches that match the prefix/suffix before/after the brace. In that case the list of completions really changes and I wanted to make it re-displayed. Which it did. Unfortunately it also re-displayed the list when no matches were `removed' or there weren't even any braces. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Mon Oct 11 19:55:18 1999 +++ Src/Zle/zle_tricky.c Mon Oct 11 20:03:02 1999 @@ -577,8 +577,17 @@ zsfree(minfo.postbr); minfo.postbr = ztrdup(lastpostbr); - if (listshown) - showinglist = -2; + if (listshown && (lastprebr || lastpostbr)) { + Cmgroup g; + Cmatch *m; + + for (g = amatches, m = NULL; g && (!m || !*m); g = g->next) + for (m = g->matches; *m; m++) + if (!hasbrpsfx(*m, minfo.prebr, minfo.postbr)) { + showinglist = -2; + break; + } + } } menuacc++; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de