zsh-workers
 help / color / mirror / code / Atom feed
* Matching Control with anchors between characters
@ 2000-04-14  7:54 Felix Rosencrantz
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Rosencrantz @ 2000-04-14  7:54 UTC (permalink / raw)
  To: zsh-workers

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. 

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.

Thanks.
-FR

__________________________________________________
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
http://invites.yahoo.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Matching Control with anchors between characters
@ 2000-04-14  8:26 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-04-14  8:26 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> 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.

Bummer. Of course, we don't have a way to specify a gap between cetain 
types of characters. But maybe what I showed is enough?

Hm... with the possible patterns in match specs I have only one
concern: speed. The gap-thing could probably be tested fast enough as
long as we don't allow too complicated patterns combinations. I
haven't really thought this through, though.

But it would almost certainly make the syntax even more irritating for
most. I think ;-)

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Matching Control with anchors between characters
@ 2000-04-14  8:04 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-04-14  8:04 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-04-14  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-14  7:54 Matching Control with anchors between characters Felix Rosencrantz
2000-04-14  8:04 Sven Wischnowsky
2000-04-14  8:26 Sven Wischnowsky

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).