From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24182 invoked from network); 8 Sep 2009 10:13:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 8 Sep 2009 10:13:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 13539 invoked from network); 8 Sep 2009 10:13:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Sep 2009 10:13:44 -0000 Received: (qmail 19580 invoked by alias); 8 Sep 2009 10:13:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27251 Received: (qmail 19564 invoked from network); 8 Sep 2009 10:13:41 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 Sep 2009 10:13:41 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id D14B6801E2BF for ; Tue, 8 Sep 2009 12:13:33 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly30g.srv.mailcontrol.com (MailControl) with ESMTP id n88ABPCf027178 for ; Tue, 8 Sep 2009 11:13:21 +0100 Received: from news01 ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 8 Sep 2009 11:12:00 +0100 Date: Tue, 8 Sep 2009 11:12:00 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: need help with enhancement to prevent completion from stat'ing automounts Message-ID: <20090908111200.57cadc7c@news01> In-Reply-To: References: <19106.55413.238410.101865@gargle.gargle.HOWL> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Sep 2009 10:12:00.0505 (UTC) FILETIME=[CE0D2690:01CA306C] X-Scanned-By: MailControl A-09-22-01 (www.mailcontrol.com) on 10.71.0.140 X-Virus-Scanned: ClamAV 0.94.2/9783/Tue Sep 8 05:50:22 2009 on bifrost X-Virus-Status: Clean On Mon, 07 Sep 2009 22:14:40 -0400 Greg Klanderman wrote: > >>>>> Greg Klanderman writes: > > > Now I just need some help to figure out what a reasonable way to > > create a general configuration to support this would be. > > So it looks like a zstyle would not work, because I need to access the > configuration from C. Seems like the only real option is to create an > array parameter - does that make sense? It's fairly easy to pass an array into C, particularly if it's going into compfiles which is the accelerator for _path_files and so has its own exclusive API, but if you really need to grope in compresult.c it's trickier. I'm not sure what API you need to access; the core completion system is heavily customized to make it possible to do clever things with multiple sets of completions, so an array applying to all of them is probably too gross. Still, if the stat is that low down in the system you've got problems. It should be possible to add an option to compadd giving an array of special things and store that in an appropriate group of results, parallel to the various other things that go into compadd. This is all quite hairy. Is your case fixed by not passing the "-f" to compadd? Then the problem is limited to _path_files and compfiles, which should be easier to trace. Separating fake and real files into different compadd calls should be possible (you're now using to advantage the facility for multiple matches that I just explained above makes it harder to change the low level stuff). There's a problem that if you're not statting the file you've completed you obviously don't know if it's a directory, so if you complete /home/u to /home/user you don't get the slash. Maybe (part of) the solution is a fake-dirs style, for stuff that is added in as directory, i.e. with a / suffix, but without the -f argument to compadd? That still needs code in _path_files but possibly not elsewhere (I'm not clear what you need to do with compfiles here). I haven't seen an easier way around your original problem---unnecessarily accessing files can be quite a big problem particular on some systems (Cygwin in my case) so a fairly general solution to this would certainly be a good thing. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom