From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19404 invoked from network); 29 Jan 2009 11:04:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Jan 2009 11:04:19 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 44833 invoked from network); 29 Jan 2009 11:04:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jan 2009 11:04:15 -0000 Received: (qmail 3630 invoked by alias); 29 Jan 2009 11:04:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26466 Received: (qmail 3618 invoked from network); 29 Jan 2009 11:04:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Jan 2009 11:04:10 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id E7FAB80271F0 for ; Thu, 29 Jan 2009 12:04:06 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly41d.srv.mailcontrol.com (MailControl) with ESMTP id n0TB3xBA013829 for ; Thu, 29 Jan 2009 11:04:00 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Thu, 29 Jan 2009 11:03:53 +0000 Date: Thu, 29 Jan 2009 11:03:53 +0000 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: help with matcher-list style Message-ID: <20090129110353.65527d81@news01> In-Reply-To: <090129005248.ZM10205@torch.brasslantern.com> References: <18817.6080.228775.132881@gargle.gargle.HOWL> <090129005248.ZM10205@torch.brasslantern.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Jan 2009 11:03:53.0868 (UTC) FILETIME=[460E24C0:01C98201] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.0.151 X-Virus-Scanned: ClamAV 0.92.1/8917/Thu Jan 29 06:38:54 2009 on bifrost X-Virus-Status: Clean On Thu, 29 Jan 2009 00:52:48 -0800 Bart Schaefer wrote: > On Jan 28, 9:43pm, Greg Klanderman wrote: > } > } I'm currently using this matcher-list setting: > } > } zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' '+ l:|=* r:|=*' > > Interesting. When I attempt to use that with the latest CVS (1.4529) > I get errors: > > 39: ../../../zsh-4.0/Src/Zle/compmatch.c:1181: bad matcher pattern type > 39: ../../../zsh-4.0/Src/Zle/compmatch.c:1181: bad matcher pattern type > (repeats a dozen times or so) > > I do NOT get that error with 4.2.0 (the only older zsh I have handy > at the moment). It's got something to do with m:{a-zA-Z}={A-Za-z} > appearing all by itself in that second element; if it appears along > with an r: pattern (for example), there is no error, and if I leave > it out, there is no error. (Move to zsh-workers.) I think this is it, but this is near the very heart of the fog, and a second pair of eyes here would be very useful. "tmpgenpat" and "wp" now have comparable relationships to "curgenpat" and "wordcp", respectively, so the code certainly looks better. Index: Src/Zle/compmatch.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v retrieving revision 1.63 diff -u -r1.63 compmatch.c --- Src/Zle/compmatch.c 18 Nov 2008 10:07:31 -0000 1.63 +++ Src/Zle/compmatch.c 29 Jan 2009 10:59:41 -0000 @@ -1818,10 +1818,12 @@ if (sfx) { wp = wordcp - 1; - curgenpat--; - } else + tmpgenpat = curgenpat - 1; + } else { + tmpgenpat = curgenpat; wp = wordcp; - if (pattern_match1(curgenpat, *wp, &wmtp)) + } + if (pattern_match1(tmpgenpat, *wp, &wmtp)) { convchar_t lchr; /* @@ -1831,8 +1833,8 @@ * else if it's generic, keep the word character, * since we have no choice. */ - if (curgenpat->tp == CPAT_CHAR) - lchr = curgenpat->u.chr; + if (tmpgenpat->tp == CPAT_CHAR) + lchr = tmpgenpat->u.chr; else lchr = *wp; @@ -1845,9 +1847,10 @@ wlen--; rl++; - if (sfx) + if (sfx) { wordcp = wp; - else { + curgenpat = tmpgenpat; + } else { if (llen) curgenpat++; wordcp++; -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070