From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8095 invoked from network); 12 Oct 2001 11:37:39 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Oct 2001 11:37:39 -0000 Received: (qmail 7278 invoked by alias); 12 Oct 2001 11:36:47 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4372 Received: (qmail 7210 invoked from network); 12 Oct 2001 11:36:36 -0000 Date: Fri, 12 Oct 2001 13:35:39 +0200 From: Goran Koruga To: zsh-users Subject: Re: Question about Completion Message-ID: <20011012133539.K26870@isis.hermes.si> References: <20011012065501.97855.qmail@web10403.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.12i In-Reply-To: <20011012065501.97855.qmail@web10403.mail.yahoo.com>; from f_rosencrantz@yahoo.com on Thu, Oct 11, 2001 at 11:55:01PM -0700 Sender: Goran Koruga X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) On Thu, Oct 11 2001, Felix Rosencrantz wrote: Hi, > I received some private replies from Goran and Sven about Clearcase filename > completion back in Sept that I thought I would forward in part to the list. (I > figure there might be a few lurkers who have some interest.) > > On Sep 23 23:54:17 2001, Goran Koruga wrote: > >Someone else has told me to use setopt automenu and setopt autolist. > >This works if I don't have my custom completion module - so later on I > >asked if there's a way to get that working. > > Check Sven's reply below... Will do so and experiment with it when I find the time for it. > >Right now I am still banging my head with the first problem - it will > >call _cc_files and _cc_co_files even when just arguments are to be > >completed. I have realized that _arguments has -A switch, but that will > >mean I have to change all calls to _arguments to add -A "-*" (I have > >actually found that in one of the man pages ;). I have checked _cvs > >script and it seems quite similar to mine, however for them the file > >completing functions are not called. > > Not sure. It might be useful to look at the trace output to see what is > happening. If you use the default bindings, there is a nice completion trace > facility via "^X-?". > > >All of this completion stuff is quite complex. Right now I will try to > >compare CVS completion against mine to try and figure out the difference. > > One problem I noticed with your completion function is that you use the "-s" > flag with _arguments. This is used if you have single letter options that can > be combined into a single word (e.g. the ls command allows "ls -la"). > Clearcase has word options, not letter options, so doesn't need this flag like > cvs does. Hmm looks like I have overlooked this one. I have removed it and didn't notice anything strange. > In response to a message where I mention some comments Sven had made some time > back in zsh-workers #9631. He makes a another possible to _path_files. (I > don't have access to clearcase, so I can't test this...) > > On Tue Sep 25 05:33:12 2001, Sven Wischnowsky responded. > >From Sven Wischnowsky Tue Sep 25 05:33:12 2001 > >I don't remember what I suggested back then and don't have the time to > >look it up now. But anyway, Goran and others using ClearCase who want > >to help could try the following: make themselves a copy of _path_files > >and insert before line 36 something like: > > > > if compset -P '*@@'; then > > # code to complete the version string here... > > return > > fi > > > >Instead of that `fi' one could try: > > > > elif (( ! $pfxsfx[(I)-[a-zA-Z12]S] )); then > > pfxsfx=( "$pfxsfx[@]" -qS '@@' ) > > fi > > > >To make it always add an automatically removable `@@' suffix if there > >isn't one from the calling function. > > > >Then if we arrive at something usable, we can start thinking about how > >to integrate that into the distribution, maybe with one or more styles > >or by adding generic code into _path_files so that can make it call > >arbitrary helper functions (with one for ClearCase being the first > >implemented) or whatever. This is definitely a good tip. I will look into this. Thanks. I have some more questions regarding my completion attempt : my completions don't get coloured. Where should I look to fix that ? It would also be nice to cache completions, but that is way beyond me right now. And is the only way to prevent calling _cc_files by using -A "-*" arguments to _arguments function ? Thanks for assistance. > > -FR. > > __________________________________________________ > Do You Yahoo!? > Make a great connection at Yahoo! Personals. > http://personals.yahoo.com > Best regards, Goran -- Writing about music is like dancing about architecture. -- Frank Zappa