Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: help with matcher-list style



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.

} Is there any way to have the substring completion not match an
} underscore at the beginning of the trial completion?

I meant to reply to your earlier message on this topic ...

} I think I essentially want 'l:|=[^_]*' but ordinary shell patterns
} do not seem to be supported.

Right, they aren't.  "*" has a special meaning and is a pattern all
unto itself, it can't be combined with other patterns.

The real difficulty is that there's no pattern that means "in this
position the text on the line must both match this pattern and also
exactly equal the text in the trial match."  The matcher list only
describes what happens in the parts of the comparison where the
text in the trial is allowed to differ.

However, I suspect matcher-list is not alone in being the culprit
here.  What is your "completer" style?

I'm also puzzled by your assertion in the earlier mail that the
ignored-patterns style doesn't work for you.  Here's what I see (with
my own slightly different matcher-list style).  Here I type "sion"
and then hit TAB.

schaefer<501> sion
Completing external command
gnome-session             gpilotd-session-wrapper   mysql_setpermission 
gnome-session-properties  gtweakui-session          svnversion 
gnome-session-remove      irpsion5
gnome-session-save        mysql_fix_extensions
Completing shell function
_apt-show-versions  _subversion         _x_extension        _xt_session_id

Erase that, install an ignored-patterns style, and try again:

schaefer<501> zstyle ':completion:*:-command-:*' ignored-patterns '_*'
schaefer<502> sion
Completing external command
gnome-session             gpilotd-session-wrapper   mysql_setpermission
gnome-session-properties  gtweakui-session          svnversion
gnome-session-remove      irpsion5
gnome-session-save        mysql_fix_extensions



Messages sorted by: Reverse Date, Date, Thread, Author