From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23647 invoked from network); 16 Jun 2008 07:17:32 -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.6 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; 16 Jun 2008 07:17:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65522 invoked from network); 16 Jun 2008 07:17:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Jun 2008 07:17:21 -0000 Received: (qmail 21506 invoked by alias); 16 Jun 2008 07:17:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25156 Received: (qmail 21493 invoked from network); 16 Jun 2008 07:17:16 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Jun 2008 07:17:16 -0000 Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by bifrost.dotsrc.org (Postfix) with ESMTP id 026DF80525A4 for ; Mon, 16 Jun 2008 09:17:12 +0200 (CEST) Received: from torch.brasslantern.com ([71.121.0.2]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K2J006OOO8DSTI2@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 16 Jun 2008 02:17:02 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m5G7H0FK008328 for ; Mon, 16 Jun 2008 00:17:01 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m5G7H0OF008327 for zsh-workers@sunsite.dk; Mon, 16 Jun 2008 00:17:00 -0700 Date: Mon, 16 Jun 2008 00:17:00 -0700 From: Bart Schaefer Subject: Re: PATCH: rewrite of completion matching In-reply-to: <10676.1212870878@pws-pc> To: zsh-workers@sunsite.dk (Zsh hackers list) Message-id: <080616001700.ZM8326@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <10676.1212870878@pws-pc> Comments: In reply to Peter Stephenson "PATCH: rewrite of completion matching" (Jun 7, 9:34pm) X-Virus-Scanned: ClamAV 0.92.1/7488/Mon Jun 16 08:06:58 2008 on bifrost X-Virus-Status: Clean Here it is a week later, and I'm finally getting a chance to really pay attention to this patch. All of the exposition sounds sensible so I'm diving right down into the patch itself for comments/questions ... seems I don't have many. On Jun 7, 9:34pm, Peter Stephenson wrote: } } +classes. The only special behaviour in correspondence classes is if } +the form on the left and the form on the right are each one of } +tt([:upper:]), tt([:lower:]). In these cases the } +character in the word and the character on the line must be the same up } +to a difference in case. Hence to make any lower case character on the } +line match the corresponding upper case character in the trial } +completion you can use `tt(m:{[:lower:]}={[:upper:]})'. Although the } +matching system does not yet handle multibyte characters, this is likely } +to be a future extension, at which point this syntax will handle } +arbitrary alphabets ; hence this form, rather than the use of explicit } +ranges, is thee recommended form. In other cases } +`tt([:)var(name)tt(:])' forms are allowed, but imply no special } +constraint on the characters beyond that implied by the test itself. I'm afraid I don't follow "imply no special constraint". Suppose I write m:{[:punct:]}={[:space:]} -- what have I just told zsh to do? And why does that differ in other than the obvious way from what it does when I tell it m:{[:lower:]}={[:upper:]} ? I *think* you mean that m:{[:punct:]}={[:space:]} is "any single punctuation character matches any single whitespace character," whereas m:{[:lower:]}={[:upper:]} is "each lower case character matches the corresponding upper case character." That is, the former works like "sed 's/[[:punct:]]/[[:space:]]/g'" but the latter works like "tr '[:lower:]' '[:upper:]'". (As "tr" allows only lower/upper to be used like this, I guess that makes sense.) } +example(compadd -M 'L:|[nN][oO]= M:_= M:{[:up[er:]}={[:lower:]}' - \ Typo there s/p\[e/ppe/.