zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Matching Control with anchors between characters
Date: Fri, 14 Apr 2000 10:04:36 +0200 (MET DST)	[thread overview]
Message-ID: <200004140804.KAA23934@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Felix Rosencrantz's message of Fri, 14 Apr 2000 00:54:16 -0700 (PDT)


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<TAB>
 ->
  % foo foo2

See? The colour thing:

  % xterm -fg IR<TAB>
 ->
  % xterm IndianRed
  IndianRed   IndianRed1  IndianRed2  IndianRed3  IndianRed4

or

  % xterm -fg IR4<TAB>
 ->
  % 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


             reply	other threads:[~2000-04-14  8:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-14  8:04 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-04-14  8:26 Sven Wischnowsky
2000-04-14  7:54 Felix Rosencrantz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200004140804.KAA23934@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).