From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 340 invoked from network); 16 Sep 2003 15:27:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Sep 2003 15:27:39 -0000 Received: (qmail 2060 invoked by alias); 16 Sep 2003 15:27:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19088 Received: (qmail 2051 invoked from network); 16 Sep 2003 15:27:32 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 16 Sep 2003 15:27:32 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.232.255] by sunsite.dk (MessageWall 1.0.8) with SMTP; 16 Sep 2003 15:27:31 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h8GFRTv30129 for zsh-workers@sunsite.dk; Tue, 16 Sep 2003 08:27:29 -0700 From: Bart Schaefer Message-Id: <1030916152729.ZM30128@candle.brasslantern.com> Date: Tue, 16 Sep 2003 15:27:29 +0000 In-Reply-To: <10378.1063706957@gmcs3.local> Comments: In reply to Oliver Kiddle "Re: Case-insensitive completion" (Sep 16, 12:09pm) References: <20030914103053.GA827@strindberg.student.uu.se> <1030914185817.ZM27558@candle.brasslantern.com> <10378.1063706957@gmcs3.local> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Case-insensitive completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii [redirected to zsh-workers from zsh-users] On Sep 16, 12:09pm, Oliver Kiddle wrote: } Subject: Re: Case-insensitive completion } } Bart wrote: } } > - 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? The docs have this example: To alter the default behaviour of file completion -- offer files matching a pattern and directories on the first attempt, then all files -- to offer only matching files on the first attempt, then directories, and finally all files: zstyle ':completion:*' file-patterns \ '%p:globbed-files' '*(-/):directories' '*:all-files' This works even where there is no special pattern: _files matches all files using the pattern `*' at the first step and stops when it sees this pattern. Note also it will never try a pattern more than once for a single completion attempt. } If it is just for efficency it should perhaps be removed. It appears to be done that way to intentionally short-circuit the process exactly when %p is '*', so that (in the example above) no redundant group 'directories' is created when both files and directories are already in the globbed-files group. The correct behavior (which may be very tough to implement) would seem to be to check the entire list of tags against the matcher style before the loop begins, and bail at '*' only if there are no tags left with matchers.