From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28049 invoked from network); 16 Sep 2003 10:07:15 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Sep 2003 10:07:15 -0000 Received: (qmail 1865 invoked by alias); 16 Sep 2003 10:07:02 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6577 Received: (qmail 1854 invoked from network); 16 Sep 2003 10:07:02 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 16 Sep 2003 10:07:02 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 16 Sep 2003 10:7:1 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-15.tower-36.messagelabs.com!1063706820!577220 X-StarScan-Version: 5.0.7; banners=-,-,- Received: (qmail 29514 invoked from network); 16 Sep 2003 10:07:00 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-15.tower-36.messagelabs.com with SMTP; 16 Sep 2003 10:07:00 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h8GA6utW004957 for ; Tue, 16 Sep 2003 11:06:57 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h8GA9Hb10380 for ; Tue, 16 Sep 2003 12:09:17 +0200 To: Zsh-users List X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1030914185817.ZM27558@candle.brasslantern.com> From: Oliver Kiddle References: <20030914103053.GA827@strindberg.student.uu.se> <1030914185817.ZM27558@candle.brasslantern.com> Subject: Re: Case-insensitive completion Date: Tue, 16 Sep 2003 12:09:17 +0200 Message-ID: <10378.1063706957@gmcs3.local> Bart wrote: > This is a start at it: > > ------- > zstyle ':completion:*:ci-globbed-files' matcher 'm:{a-z}={A-Z}' > zstyle ':completion:*' file-patterns \ > '(#I)%p:globbed-files %p:ci-globbed-files' '*:all-files' > zstyle ':completion:*' group-order globbed-files ci-globbed-files all-files > zstyle ':completion:*' group-name '' > ------- > > The difficulties are: > > - It may work differently when completing in default context than when > completing after a command such as "ls" that has its own completion > function defined. E.g., "ls" somehow ignores the globbed-files group > and goes directly to ci-globbed-files, I don't know why. Problem is related to nested tag loops and the old problem of ordering of options passed down versus those determined further down. In this case, all matches are going into an argument-rest group thanks to _arguments and the more specific group names get ignored. I can't see a way round it using styles because you can't avoid the -default- group. Not easy to solve more generally either. Long term we probably need to keep track of the whole chain of tags used along the way. > - It's quite difficult to express the concept "only files that match > case-insensitively, not those that match case-sensitively." Thus the > ci-globbed-files group is a superset of globbed-files and you get a > redundant listing. This is a bit unfortunate. Matching control probably needs a way to specify that only matches which needed the rule should be matched. Handling ordering for pure menu completion users is simply something which was never particularly considered. > - file-patterns are not tried after the first one that has the pattern > '*:...' which is why the (#I) is thrown in on globbed-files, to force > attempting both globbed-files and ci-globbed-files even if the match > pattern substituted by %p is '*'. Yuk. Could you see if there was a good reason for that? If it is just for efficency it should perhaps be removed. Will fall down with other styles like ignored-patterns and ignore-line. > Also note that there was at least one dev release where %p was not > handled properly. I don't recall whether 4.0.7 has that bug. I tried > the above only with the current CVS incarnation of 4.1.1-dev-1. I think that bug is in 4.0.7 which is quite bad really. Oliver