From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22628 invoked from network); 9 Mar 1999 15:46:52 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Mar 1999 15:46:52 -0000 Received: (qmail 2332 invoked by alias); 9 Mar 1999 15:46:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5716 Received: (qmail 2310 invoked from network); 9 Mar 1999 15:46:14 -0000 Date: Tue, 9 Mar 1999 16:43:59 +0100 (MET) Message-Id: <199903091543.QAA15388@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Tue, 9 Mar 1999 18:16:04 +0300 Subject: Re: accept-and-menu-complete in braces and suffixes Andrej Borsenkow wrote: > This is with zsh -f: > > itsrm2% l {Commands/ESC-RETURN > Commands/ Core/ > itsrm2% l {Commands/,Core/ > Commands/ Core/ > > The slash is removed if I type anything but not with > accept-and-menu-complete. Not with anything, but with a comma and a brace, so a-a-m-c should do the same, right. `iremovesuffix()' has a new argument now, saying if the list of matches should be kept. Bye Sven diff -u os/Zle/zle.h Src/Zle/zle.h --- os/Zle/zle.h Tue Mar 9 15:56:55 1999 +++ Src/Zle/zle.h Tue Mar 9 16:39:11 1999 @@ -125,7 +125,7 @@ /* Standard type of suffix removal. */ -#define removesuffix() iremovesuffix(256) +#define removesuffix() iremovesuffix(256, 0) /* Cut/kill buffer type. The buffer itself is purely binary data, * * not NUL-terminated. len is a length count. flags uses the * diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c --- os/Zle/zle_misc.c Tue Mar 9 15:56:55 1999 +++ Src/Zle/zle_misc.c Tue Mar 9 16:39:27 1999 @@ -42,7 +42,7 @@ int neg = zmult < 0; /* insert *after* the cursor? */ int m = neg ? -zmult : zmult; /* number of copies to insert */ - iremovesuffix(c1); + iremovesuffix(c1, 0); invalidatelist(); if(insmode) @@ -849,7 +849,7 @@ /**/ void -iremovesuffix(int c) +iremovesuffix(int c, int keep) { if (suffixfunc) { List l = getshfunc(suffixfunc); @@ -876,7 +876,8 @@ int sl = suffixlen[c]; if(sl) { backdel(sl); - invalidatelist(); + if (!keep) + invalidatelist(); } } fixsuffix(); diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Tue Mar 9 15:56:56 1999 +++ Src/Zle/zle_tricky.c Tue Mar 9 16:39:40 1999 @@ -463,7 +463,11 @@ return; } if (brbeg && *brbeg) { - int l = (brscs >= 0 ? brscs : cs) - brpcs; + int l; + + iremovesuffix(',', 1); + + l = (brscs >= 0 ? brscs : cs) - brpcs; zsfree(brbeg); brbeg = (char *) zalloc(l + 2); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de