From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28671 invoked from network); 25 Dec 2004 17:33:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Dec 2004 17:33:04 -0000 Received: (qmail 91340 invoked from network); 25 Dec 2004 17:32:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Dec 2004 17:32:58 -0000 Received: (qmail 14432 invoked by alias); 25 Dec 2004 17:32:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20638 Received: (qmail 14418 invoked from network); 25 Dec 2004 17:32:43 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Dec 2004 17:32:43 -0000 Received: (qmail 91041 invoked from network); 25 Dec 2004 17:32:27 -0000 Received: from mx1.mail.ru (194.67.23.121) by a.mx.sunsite.dk with SMTP; 25 Dec 2004 17:32:25 -0000 Received: from ppp83-237-195-42.pppoe.mtu-net.ru ([83.237.195.42]:33144 helo=[10.0.0.3]) by mx1.mail.ru with asmtp id 1CiFmD-0000tL-00 for zsh-workers@sunsite.dk; Sat, 25 Dec 2004 20:32:25 +0300 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: Strange _values completion on accept-and-menu-complete and menu selection Date: Sat, 25 Dec 2004 20:32:22 +0300 User-Agent: KMail/1.7.1 References: <200412111311.27916.arvidjaar@mail.ru> <200412130006.56691.arvidjaar@mail.ru> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200412252032.23247.arvidjaar@mail.ru> X-Spam: Not detected 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 Monday 13 December 2004 00:44, Bart Schaefer wrote: > On Mon, 13 Dec 2004, Andrey Borzenkov wrote: > > > Normally compstate[compound_word] would be unset, but "compvalues -i" > > > would set it based on the parse. > > > > I still believe this is more general and should not be limited to _values > > Sure; compstate[compound_word] doesn't have to be read-only, any function > that needs it could set it. It just seems correct and convenient to have > compvalues set it automatically. > > > Here is updated patch (which also fixes initialization problem). > > There's one line of shell code where you have compstate[compound] but want > compstate[compound_word]. No need to repost, but fix before commit. > it is far from being suitable for commit (and I was off most of the time). > > This still has problems in completing nested calls to _values (should it > > work?) > > I don't have time to debug carefully just now, but I suspect without any > real evidence that compstate[compound_word] is becoming unset on return > from the nested call and therefore is wrong for the subsequent selections > for the outer call. it is more general problem. When match is inserted it has all parts - ignored prefix, prefix, etc insterted. In our case we actually have as iprefix everything up to separator - and get everything up to separator reinserted. It happens without any nested calls too: {pts/0}% foo foo,TAB {pts/0}% foo foo,bazzz, Completing test values barr bazzz and hitting a-a-m-c {pts/0}% foo foo,bazzz,foo,barr It is the same problem as completion in braces. Braces are treated as special case inside completion code unfortunately. Hopefully it is possile to generalize it. -andrey