zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: case insensitive completion
Date: Wed, 14 May 2008 10:47:57 +0100	[thread overview]
Message-ID: <20080514104757.01013e55@news01> (raw)
In-Reply-To: <482839D5.6070901@sergio.spb.ru>

On Mon, 12 May 2008 16:36:37 +0400
sergio <zsh@sergio.spb.ru> wrote:
> zstyle ':completion:*' matcher-list 'm:{а-яА-Я}={А-Яа-я}
> doesn't work

I think this really needs fixing a more general way.  You don't care what
the character set is, you just want to make lower and upper case match.  So
really you want to be able to use ctype-style character specifications:

zstyle ':completion:*' matcher-list \
       'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'

More general ctype tests would also be useful in:

  compadd -M 'r:|[.,_-]=* r:|=*'

which could be

  compadd -M 'r:|[[:punct:]]=* r:|=*'

and it's a bit confusing that that doesn't currently work---it's not
spelled out in the completion documentation.

That doesn't leave much for individual multibyte characters in
correspondence classes to do, but it still shouldn't be too difficult to
turn the tables into explicit sets of characters tested the way character
classes in globbing are tested (which is fully general, although based on
the wchar_t ordering, which isn't necessarily Unicode code points).

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  parent reply	other threads:[~2008-05-14  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 12:36 sergio
2008-05-12 12:52 ` Peter Stephenson
2008-05-13  5:40 ` Andrey Borzenkov
2008-05-14  9:47 ` Peter Stephenson [this message]
2008-05-14 14:12   ` sergio

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=20080514104757.01013e55@news01 \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.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).