From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7509 invoked from network); 19 Feb 2008 10:19:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Feb 2008 10:19:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65294 invoked from network); 19 Feb 2008 10:19:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Feb 2008 10:19:25 -0000 Received: (qmail 4681 invoked by alias); 19 Feb 2008 10:19:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24571 Received: (qmail 4666 invoked from network); 19 Feb 2008 10:19:21 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Feb 2008 10:19:21 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id D78658026E0E for ; Tue, 19 Feb 2008 11:19:16 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly29d.srv.mailcontrol.com (MailControl) with ESMTP id m1JAImuD023060 for ; Tue, 19 Feb 2008 10:19:14 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Feb 2008 10:19:04 +0000 Date: Tue, 19 Feb 2008 10:19:04 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: _approximate doesn't work Message-ID: <20080219101904.010f8df8@news01> In-Reply-To: <080219002936.ZM16243@torch.brasslantern.com> References: <200802171925.m1HJPbE8009696@pws-pc.ntlworld.com> <080218013338.ZM15026@torch.brasslantern.com> <080219002936.ZM16243@torch.brasslantern.com> Organization: CSR X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Feb 2008 10:19:04.0200 (UTC) FILETIME=[DA5FA080:01C872E0] X-Scanned-By: MailControl A-08-00-01 (www.mailcontrol.com) on 10.68.0.139 X-Virus-Scanned: ClamAV 0.91.2/5886/Tue Feb 19 09:09:14 2008 on bifrost X-Virus-Status: Clean On Tue, 19 Feb 2008 00:29:35 -0800 Bart Schaefer wrote: > The problem is that at the line above in _path_commands, PREFIX is > always "xsane_g" (using PWS's test) and never "(#a1)xsane_g". > > Looking through the output, PREFIX gets set by the replacement compadd > created via _approximate -- but that doesn't happen until *inside* the > call to _wanted, long after the test in _path_commands. You're right this is happening quite late, and I think PREFIX is being restored automatically (by the compstate[restore]=auto mechanism), which is what I missed (a previously modified version of PREFIX wouldn't be picked up). However, this is an extremely general problem. Very many completion functions assume quite reasonably that testing PREFIX tests what the completer is trying to match. Perhaps we need to make approximation/correction more visible by introducing parameters that are local to the completion system and only contain text in the appropriate case (e.g. APPROX="(#a1)")? -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070