From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17496 invoked from network); 14 Apr 2000 08:04:48 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Apr 2000 08:04:48 -0000 Received: (qmail 21341 invoked by alias); 14 Apr 2000 08:04:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10753 Received: (qmail 21328 invoked from network); 14 Apr 2000 08:04:38 -0000 Date: Fri, 14 Apr 2000 10:04:36 +0200 (MET DST) Message-Id: <200004140804.KAA23934@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Felix Rosencrantz's message of Fri, 14 Apr 2000 00:54:16 -0700 (PDT) Subject: Re: Matching Control with anchors between characters Felix Rosencrantz wrote: > I don't completely understand matching control. I use it and it's wonderful, > but it's still a mystery to me. I did attempt to read the manual a bit when I > was first converting over to zsh. One thing that seemed to be missing, was the > ability to specify anchors between characters. In particular, I wanted to > configure anchors between numbers and non-numbers so that f2 could match > something like filesystem2. None of the examples seemed to talk about this. > > Since, there is some discussion about patterns that match the gaps between > characters, it would be nice if this would also work for the anchor patterns of > matching control. Yes, I've been thinking about adding something like this to the manual, too -- and then forgot, as usual. I would have used the match spec used by the functions that complete X colour names as an example, which allows to use the uppercase letters (and digits) as shortcuts. The same is possible with digits. The point is that, different from what the examples we give seem to imply, the anchor need not be anything special: % ls foo1 foo2 foo3 % zstyle ':completion:*:*:foo:*' matcher 'r:|[0-9]=* r:|=*' % foo f2 -> % foo foo2 See? The colour thing: % xterm -fg IR -> % xterm IndianRed IndianRed IndianRed1 IndianRed2 IndianRed3 IndianRed4 or % xterm -fg IR4 -> % xterm -fg IndianRed4 Isn't live just fun? Sometimes. > Or maybe someone will just point out my misunderstanding and supply a matching > specification that does what I want. I'd be willing to add the example to the > manual. Wow, someone offers to improve the manual... I'd be very thankful. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de