From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13837 invoked from network); 12 Mar 2000 20:14:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Mar 2000 20:14:31 -0000 Received: (qmail 25175 invoked by alias); 12 Mar 2000 20:14:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10096 Received: (qmail 25163 invoked from network); 12 Mar 2000 20:14:25 -0000 Date: Sun, 12 Mar 2000 20:14:23 +0000 From: Adam Spiers To: zsh-workers@sunsite.auc.dk Subject: Re: _files vs _path_files discussion (old thread) Message-ID: <20000312201423.A10537@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh-workers@sunsite.auc.dk References: <20000311222225.A27795@thelonious.new.ox.ac.uk> <1000312001854.ZM26814@candle.brasslantern.com> <20000312005127.A28688@thelonious.new.ox.ac.uk> <1000312062134.ZM27047@candle.brasslantern.com> <1000312063459.ZM27076@candle.brasslantern.com> <199909170728.JAA01949@beta.informatik.hu-berlin.de> <20000312130233.A4744@thelonious.new.ox.ac.uk> <1000312194332.ZM27890@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <1000312194332.ZM27890@candle.brasslantern.com>; from schaefer@candle.brasslantern.com on Sun, Mar 12, 2000 at 07:43:32PM +0000 X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: Linux 2.2.12 i686 Bart Schaefer (schaefer@candle.brasslantern.com) wrote: > On Mar 12, 1:02pm, Adam Spiers wrote: > } Subject: Re: _files vs _path_files discussion (old thread) > } > } # Include non-hidden directories in globbed file completions > } compstyle '::complete:*' \ > } tag-order 'globbed-files directories' all-files > } compstyle '::complete:*:*:directories' file-patterns '*~.*(-/)' > } > } It's almost perfect ... > > Have you tried that with, say, `ls' ? I'll bet it ends up completing > _only_ directories, because there's no -g option passed to _files for > `ls' like there is for `tar'. Of course you're right, and I had to change it back as soon as I realised :-( > If you have global directories file-patterns you're going to need them > for globbed-files, too ... Why's that? I'm still not fully understanding this, it seems. > Do you have the GLOB_DOTS option set, by chance? I did, until you pointed it out ;-) > Effectively, what you want is to subdivide the 'directories' tag and > have it treated like it has it's own internal tag-order. That's right. Now why couldn't I have thought clearly enough to realise that? > One possibility would be to make file-patterns itself into a hierarchy; > that is > > zstyle :completion::complete:tar::directories \ > file-patterns '*(-/)' '.*(-/)' > > would mean to use '.*(-/)' only if '*(-/)' returned nothing. The current > meaning of the above is also expressible by > > zstyle :completion::complete:tar::directories \ > file-patterns '*(-/) .*(-/)' > > (that is, file-patterns is presently a string, not an array) so we would > not be losing any functionality. > > Then all we need is a magic token in file-patterns to mean "use anything > passed to _files with the -g option here" and global file-patterns would > become really useful. That sounds really nice.