From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21539 invoked from network); 8 Dec 1999 13:49:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Dec 1999 13:49:56 -0000 Received: (qmail 29587 invoked by alias); 8 Dec 1999 13:49:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8945 Received: (qmail 29580 invoked from network); 8 Dec 1999 13:49:45 -0000 Date: Wed, 8 Dec 1999 14:49:44 +0100 (MET) Message-Id: <199912081349.OAA27690@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Wed, 8 Dec 1999 10:13:06 +0000 Subject: Re: PATCH: hidden matches in menu-select Bart Schaefer wrote: > (Maybe we should change the color-cap to "du"plicate instead of "mu"ltiple? > Neither the original paragraph nor this rewite explains the derivation of > "mu".) Good idea. I wasn't too lucky with it anyway because we already had `ma' and `mi'. This also fixes a small bug which made the listing code think that (almost) all matches were duplicates. Bye Sven diff -ru ../z.old/Doc/Zsh/mod_complist.yo Doc/Zsh/mod_complist.yo --- ../z.old/Doc/Zsh/mod_complist.yo Wed Dec 8 14:44:36 1999 +++ Doc/Zsh/mod_complist.yo Wed Dec 8 14:45:02 1999 @@ -167,7 +167,7 @@ in the list (because they differ only in things like prefixes or suffixes that are not displayed). In the list used for menu-selection, however, even these matches are shown so that it is possible to select -them. To highlight such matches the tt(hi) and tt(mu) capabilities in +them. To highlight such matches the tt(hi) and tt(du) capabilities in the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters are supported for hidden matches of the first and second kind, respectively. diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c --- ../z.old/Src/Zle/compcore.c Wed Dec 8 10:09:32 1999 +++ Src/Zle/compcore.c Wed Dec 8 14:20:15 1999 @@ -2368,16 +2368,21 @@ (int (*) _((const void *, const void *)))matchcmp); if (!(flags & CGF_UNIQCON)) { + int dup; + /* And delete the ones that occur more than once. */ for (ap = cp = rp; *ap; ap++) { *cp++ = *ap; for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--); ap = bp; /* Mark those, that would show the same string in the list. */ - for (; bp[1] && !(*ap)->disp && !(bp[1])->disp && - !strcmp((*ap)->str, (bp[1])->str); bp++) + for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp && + !strcmp((*ap)->str, (bp[1])->str); bp++) { (bp[1])->flags |= CMF_MULT; - (*ap)->flags |= CMF_FMULT; + dup = 1; + } + if (dup) + (*ap)->flags |= CMF_FMULT; } *cp = NULL; } @@ -2399,14 +2404,19 @@ *cp = NULL; } } else if (!(flags & CGF_UNIQCON)) { + int dup; + for (ap = cp = rp; *ap; ap++) { *cp++ = *ap; for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--); ap = bp; - for (; bp[1] && !(*ap)->disp && !(bp[1])->disp && - !strcmp((*ap)->str, (bp[1])->str); bp++) + for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp && + !strcmp((*ap)->str, (bp[1])->str); bp++) { (bp[1])->flags |= CMF_MULT; - (*ap)->flags |= CMF_FMULT; + dup = 1; + } + if (dup) + (*ap)->flags |= CMF_FMULT; } *cp = NULL; } diff -ru ../z.old/Src/Zle/complist.c Src/Zle/complist.c --- ../z.old/Src/Zle/complist.c Wed Dec 8 10:09:33 1999 +++ Src/Zle/complist.c Wed Dec 8 14:44:42 1999 @@ -58,7 +58,7 @@ #define COL_SP 14 #define COL_MA 15 #define COL_HI 16 -#define COL_MU 17 +#define COL_DU 17 #define NUM_COLS 18 @@ -70,7 +70,7 @@ static char *colnames[] = { "no", "fi", "di", "ln", "pi", "so", "bd", "cd", "ex", "mi", - "lc", "rc", "ec", "tc", "sp", "ma", "hi", "mu", NULL + "lc", "rc", "ec", "tc", "sp", "ma", "hi", "du", NULL }; /* Default values. */ @@ -659,7 +659,7 @@ } else if (m->flags & CMF_NOLIST) zcputs(&mcolors, g->name, COL_HI); else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT))) - zcputs(&mcolors, g->name, COL_MU); + zcputs(&mcolors, g->name, COL_DU); else subcols = putmatchcol(&mcolors, g->name, m->disp); if (subcols) @@ -698,7 +698,7 @@ } else if (m->flags & CMF_NOLIST) zcputs(&mcolors, g->name, COL_HI); else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT))) - zcputs(&mcolors, g->name, COL_MU); + zcputs(&mcolors, g->name, COL_DU); else if (buf) subcols = putfilecol(&mcolors, g->name, path, buf->st_mode); else -- Sven Wischnowsky wischnow@informatik.hu-berlin.de