From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24294 invoked from network); 11 Mar 2000 22:22:34 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Mar 2000 22:22:34 -0000 Received: (qmail 6590 invoked by alias); 11 Mar 2000 22:22:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10075 Received: (qmail 6578 invoked from network); 11 Mar 2000 22:22:26 -0000 Date: Sat, 11 Mar 2000 22:22:25 +0000 From: Adam Spiers To: zsh-workers@sunsite.auc.dk Subject: Re: _files vs _path_files discussion (old thread) Message-ID: <20000311222225.A27795@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh-workers@sunsite.auc.dk References: <199909170728.JAA01949@beta.informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <199909170728.JAA01949@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Fri, Sep 17, 1999 at 09:28:26AM +0200 X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: Linux 2.2.12 i686 [digging up a very old thread] Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote: > > Peter Stephenson wrote: > > > Adam Spiers wrote: > > > Now people may disagree with this, but I would have thought that in > > > many completion scenarios, _path_files -/ -g is more > > > appropriate than _files -g . For example, when completing tar > > > archives, if there are none in directory foo, and you type > > > > ... > > > > A second issue is whether, if you find target files in the current > > directory, you might still want to complete directories. This is also hard > > to generalise on, since if you are completing a common enough file type you > > might very well want to be offered directories straight away, while if > > there aren't many of that type they may just get in the way. But probably > > we need to be more consistent, rather than depending on who happened to > > write the completion file. Does the new zstyle stuff now provide some kind of configurability to solve this issue? Here's a practical example of the issue, just to make sure it's clear what I'm talking about: Suppose I have, in the cwd, a file `foo.tar.gz' and a directory `foo'. I type: $ tar zxf foo Currently, this immediately completes to `foo.tar.gz'. But what if I actually wanted to extract a .tar.gz from somewhere within the directory foo? According to _complete_help, _tar calls _tar_archive, which calls _files, which generates the tags `globbed-files', `directories', and `all-files'. Presumably because some globbed-files were found, directories were not added to the list of completions. Is it possible to set some style appropriately so that directories are listed immediately along with tarballs? I'm interested in a general solution which would apply to all invocations of `_files -g ...'. Incidentally, the more I understand of the new completion system, the more I like it. Sure, it's very intricate and takes a lot of getting used to, but it seems to me that the various concepts have been abstracted out in just the right way so as to allow completion function writers maximum flexibility and convenience. It's also great that the end-user can just press TAB and instantly enjoy all this power without worrying about how it works, and that there is so much configurability available from zstyle. Congratulations to everyone involved, especially (needless to say) Sven! Adam