From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29011 invoked from network); 26 Mar 2006 07:15:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2006 07:15:26 -0000 Received: (qmail 89039 invoked from network); 26 Mar 2006 07:15:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 07:15:19 -0000 Received: (qmail 4720 invoked by alias); 26 Mar 2006 07:15:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10082 Received: (qmail 4710 invoked from network); 26 Mar 2006 07:15:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Mar 2006 07:15:08 -0000 Received: (qmail 87539 invoked from network); 26 Mar 2006 07:15:08 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 07:15:06 -0000 Received: from torch.brasslantern.com ([71.116.81.225]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IWQ007GN454UFS2@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Sun, 26 Mar 2006 01:15:05 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k2Q7Iu6c006757 for ; Sat, 25 Mar 2006 23:18:57 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k2Q7Iu8d006756 for zsh-users@sunsite.dk; Sat, 25 Mar 2006 23:18:56 -0800 Date: Sat, 25 Mar 2006 23:18:56 -0800 From: Bart Schaefer Subject: Re: Textfile-Favoring Completion In-reply-to: <20060325181625.GA17430@namib.cs.utk.edu> To: zsh-users@sunsite.dk Message-id: <060325231856.ZM6755@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20060325181625.GA17430@namib.cs.utk.edu> Comments: In reply to Chris Johnson "Textfile-Favoring Completion" (Mar 25, 1:16pm) On Mar 25, 1:16pm, Chris Johnson wrote: } } Now I'm using something slightly simpler that has the same drawback as } the first solution in hiding certain files when there's a valid match in } the first group. (For instance, I want to complete an executable plain } file 'itself.sh' but there's a directory 'include' that supercedes.) It } does cut back on the regular expression maintenance, though. (I haven't } entered the extensions for LaTeX yet, so this may change.) } } # First match files that aren't plain executable files or don't } # end in .o. Failing that, match anything. } zstyle ':completion:*:*:(emacs|vi|vim):*' file-patterns \ } '*~*.o(^*):globbed-files' '*:all-files' If you're going to go about it that way, look at ignored-patterns: zstyle ':completion:*:*:(emacs|vi|vim):*' ignored-patterns '*.o' You may find it easier to maintain the list of excluded patterns there. The drawback to ignored-patterns is that they're matched only against the text of the file name, not used as file globs, so you can't, e.g., ignore files with the execute bit set. However, if you combine it with a variant of your file-patterns style ... zstyle ':completion:*:*:(emacs|vi|vim):*' file-patterns \ '*(.^*):globbed-files *(/):directories' '*:all-files' ... you may get something very close to what you want. Just remember that you may also want to put _ignored into your completer style somewhere.