From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25490 invoked from network); 13 Mar 2000 17:54:40 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Mar 2000 17:54:40 -0000 Received: (qmail 29774 invoked by alias); 13 Mar 2000 17:54:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10124 Received: (qmail 29754 invoked from network); 13 Mar 2000 17:54:32 -0000 From: "Bart Schaefer" Message-Id: <1000313175404.ZM2874@candle.brasslantern.com> Date: Mon, 13 Mar 2000 17:54:04 +0000 In-Reply-To: <200003131307.OAA19863@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: _files vs _path_files discussion (old thread)" (Mar 13, 2:07pm) References: <200003131307.OAA19863@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: _files vs _path_files discussion (old thread) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 13, 2:07pm, Sven Wischnowsky wrote: } Subject: Re: _files vs _path_files discussion (old thread) } } Bart Schaefer wrote: } > One additional thought: It would be nice to be able to specify that } > _paths_ are completed, rather than merely directories; i.e. like the } > difference between "compctl -g '*(-/)'" and "compctl -/". I'm not } > convinced that "zstyle *directories file-patterns '*(-/)'" does that. } } Actually, I thought that _path_files makes it behave like `compctl -/', } where do you see a difference? I don't, actually ... so probably there isn't any. } > One possibility would be to make file-patterns itself into a hierarchy; } } Nice idea. And doesn't sound too hard to implement... } } > 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. } } Maybe we could just use an empty string as the magic token, it's used } elsewhere already. } } First question: should the magic token only be used for -g or also for } -/ (i.e. should it mean: `the glob-pattern from the caller' or `the } files selected by the caller'). It should mean the files selected by the caller. } Much more dramatic second question: should we get rid of globbed-files, } directories, all-files? The problem with getting rid of them is that e.g. _cvs uses 'directories' to mean something different than '*(-/)' (in effect, to omit the CVS/ subdir and any subdir that doesn't contain a CVS/ subdir). It's useful to be able to define "directories" independently of other glob tags. (Of course, _cvs and its helpers don't test the file-patterns or call _files, they use compadd directly. So it's not quite the same issue, but it could still come up.) } Allowing multiple patterns in file-patterns and still using multiple } tags doesn't add much to functionality, but adds a lot to obscurity, I } think. Perhaps. } file-patterns == 'globbed-files:*.ps' 'directories:*(-/)' ... } } or something like that. That might cover it, though I dislike putting the tag name in the same word as the pattern. We already have too many strings that have to be split into substrings before interpreting, as far as I'm concerned. } [...] And then [_files] calls _path_files for the patterns until } one generates matches. Either always using the files tag or the tags } given in the file-patterns value (if we implement that; should the } standard patterns automatically derived from the arguments of _files } use the tags we use now, then?). I don't understand the question, I fear. } Changing _files this way would make it much easier (and better } readable and hence easier to modify), obviously. I'm all in favor of that ... } But it would mean that users would have to fiddle with glob patterns } instead of only tags in this case -- I'm never sure, what is } considered too inconvenient: is this onme of those cases? I don't think users fiddling with glob patterns is a problem; it's not much by comparison with figuring out style context names in the first place. I'm more concerned about what the completion functions do in cases like the _cvs example I mentioned above. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com