From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9423 invoked from network); 15 Dec 2003 19:37:26 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Dec 2003 19:37:26 -0000 Received: (qmail 23688 invoked by alias); 15 Dec 2003 19:37:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19292 Received: (qmail 23644 invoked from network); 15 Dec 2003 19:37:19 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 15 Dec 2003 19:37:19 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.11.8.53] by sunsite.dk (MessageWall 1.0.8) with SMTP; 15 Dec 2003 19:37:18 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id hBFJbHQ13528 for zsh-workers@sunsite.dk; Mon, 15 Dec 2003 11:37:17 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1031215193717.ZM13527@candle.brasslantern.com> Date: Mon, 15 Dec 2003 19:37:17 +0000 In-Reply-To: <5719.1071514564@gmcs3.local> Comments: In reply to Oliver Kiddle "Re: Completion in pwd before subdirecories" (Dec 15, 7:56pm) References: <20031213154651.GR18859@strindberg.dsv.su.se> <1031213191918.ZM5325@candle.brasslantern.com> <20031213233905.GW18859@strindberg.dsv.su.se> <3213.1071488991@gmcs3.local> <1031215170258.ZM12804@candle.brasslantern.com> <5719.1071514564@gmcs3.local> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh workers Subject: Re: Completion in pwd before subdirecories MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 15, 7:56pm, Oliver Kiddle wrote: } } It has never seemed ideal to me that, for example, gunzip completion } will complete a directory called dir.gz even if the user has } directories after files in their file-patterns style. Ideally we should } tidy things up from the completion functions and not expect user's to } set the file-patterns style for every command. } } For the majority of commands we use something like _files -g '*.gz' to } specify a filename extension. These should ideally not match } directories. So why aren't we using "_files -g '*.gz(.)'" in that case? The most general case is that we want globs to match both directories and files. If the user is actually completing (rather than expanding) a word containing a glob pattern, in the absence of other info (such as that gzip can't inflate a directory) I'd think the user expectation is that all the matches get lumped together. It's quite possible that I'm still missing something, though. } One option might be for _files to add the (^-/) when substituting } %p and to add a -/g option to suppress this when the glob should also } match directories. I'm not convinced that this wouldn't amount to coding for a fringe case and turning the most common situation into an option. } We could even have other escapes in addition to %p which give the user } more control. A user who relies on _next_tags to get at directories } may want explicitly globbed directories first for commands like chown. I agree in principle with that, though.