From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 503 invoked from network); 12 Sep 2000 06:59:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Sep 2000 06:59:53 -0000 Received: (qmail 24840 invoked by alias); 12 Sep 2000 06:59:01 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3421 Received: (qmail 24829 invoked from network); 12 Sep 2000 06:58:59 -0000 From: "Bart Schaefer" Message-Id: <1000912065847.ZM5756@candle.brasslantern.com> Date: Tue, 12 Sep 2000 06:58:47 +0000 In-Reply-To: Comments: In reply to Alexandre Duret-Lutz "more wishes with automounter" (Sep 11, 7:33pm) References: <200009111436.KAA02215@soup.ads.apexinc.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Alexandre Duret-Lutz , zsh-users@sunsite.auc.dk Subject: Re: more wishes with automounter MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 11, 7:33pm, Alexandre Duret-Lutz wrote: } Subject: more wishes with automounter } } /nfs/hosts1 -> /var/autofs/nfs/host1 } /nfs/hosts2 -> /var/autofs/nfs/host2 } /nfs/hosts3 -> /var/autofs/nfs/host3 } etc... } } The problem is that using Zsh to complete /nfs/hos will } mount *all* the directories, because the completion code stat() } all links (and stat()ing a link will lead to the mount of the } linked directory). I believe that Zsh may use lstat() instead, } but since I don't know where that guilty stat() is I haven't } tried. I think the stat must be an effect of the way _path_files does globbing to try to segregate files by type. I don't see any stat() calls in strace output if I don't have any styles set (and this time I did check that the new completion system really was loaded (blush)). Try this: ztyle -e ':completion:*' file-patterns \ '[[ $PREFIX == /nfs/[^/]# ]] && \ { setopt noglob ; reply=(*(@)) ; setopt glob }' (Twaddling noglob like that was the only way I could get zstyle -e to put a file pattern into $reply -- the eval-ing messed up any other quoting I could think of.) This just says that if you're completing within the /nfs/ directory itself, don't consider anything other than symlinks. As I'm not sure why/where those links are getting stat()d, this may not be of any help ... but then again, it may. } [*] another wish would be that Zsh complete those invisible } directories; or more generaly: give the user the possiblity } to add "virtual files" (anywhere he want), that Zsh would } use for completion. The article that PWS referenced about this is zsh-users/3408. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net