From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5880 invoked from network); 11 Dec 2004 21:07:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Dec 2004 21:07:25 -0000 Received: (qmail 13265 invoked from network); 11 Dec 2004 21:07:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Dec 2004 21:07:19 -0000 Received: (qmail 18042 invoked by alias); 11 Dec 2004 21:07:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20619 Received: (qmail 18018 invoked from network); 11 Dec 2004 21:07:03 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Dec 2004 21:07:03 -0000 Received: (qmail 12767 invoked from network); 11 Dec 2004 21:06:04 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 11 Dec 2004 21:06:02 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id iBBL5wh4026347; Sat, 11 Dec 2004 13:05:58 -0800 Date: Sat, 11 Dec 2004 13:05:58 -0800 (PST) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: Andrey Borzenkov cc: zsh-workers@sunsite.dk Subject: Re: Strange _values completion on accept-and-menu-complete and menu selection In-Reply-To: <200412111311.27916.arvidjaar@mail.ru> Message-ID: References: <200412111311.27916.arvidjaar@mail.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sat, 11 Dec 2004, Andrey Borzenkov wrote: > Apparently it does not work any more for _values; I presume it did work > once because _urpmi completion includes _values usage in question. Looking at the code, I can't see any way it ever worked. There's been no interesting change anywhere near or beyond (in the function call sense) the point where complist.c handles accept-and-menu-complete. The problem is that accept_last() is called, which eventually always calls iremovesuffix(' ', 1). If "compadd -R" had been used, the suffix function would be called and could subvert the behavior of iremovesuffix(), but as it stands the suffix is always zapped. The deeper problem seems to be that the complist module doesn't really know anything about compvalues; e.g., as far as complist is concerned it's selecting among shell words, not from a set of values that are part of a word. That it comes as close as it does to working is serendipitous. A fix seems to be something in the direction of this pseudo-patch (do NOT apply it as-is) to compresult.c, but I don't know how to get the boolean value for "we are not completing values from compvalues" at this location. @@ -1241,16 +1241,19 @@ lastbrbeg->str[l + 1] = '\0'; } else { int l; + int rem = /* We are not completing values from compvalues */; cs = minfo.pos + minfo.len + minfo.insc; - iremovesuffix(' ', 1); + if (rem) + iremovesuffix(' ', 1); l = cs; cs = minfo.pos + minfo.len + minfo.insc - (*(minfo.cur))->qisl; if (cs < l) foredel(l - cs); else if (cs > ll) cs = ll; - inststrlen(" ", 1, 1); + if (rem) + inststrlen(" ", 1, 1); minfo.insc = minfo.len = 0; minfo.pos = cs; minfo.we = 1;