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

Re: zsh versus tcsh's "complete=enhance" (for Germans)



Peter Stephenson wrote:
> Andy Spiegl wrote:
> > for case-insensitive German I am using this:
> >  zstyle ":completion:*" matcher-list 'm:{A-Zöäüa-zÖÄÜ}={a-zÖÄÜA-Zöäü}'
> >
> > Is there a shorter way to write this?
> 
> It looks like equivalence classes (the braces in that pattern) for
> completion matchers are fairly simply handled at present.  The code for
> this part of the matching appears (for once) not to be too tortuous and
> it ought to be possible to extend it.

Guess what... it's not as easy as all that.

[Waits for gasps of amazement to subside.]

The current code appears to be broken with multibyte characters, in
fact, since it uses a lookup table of 256 characters.  The matcher
system is fairly heavily embedded into the completion code, so it may
well be too much like hard work to rewrite the whole thing using wide
characters.  However, it ought to be possible (if rather slower) to
store only the matcher pattern as wide characters and convert the
character for comparison on input, or alternatively simply determine the
multibyte character length each time (yuk) and use that to look for
substrings.

Anybody who feels strongly enough that the whole thing should be written
properly and efficiently is encouraged to do so...

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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