From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18321 invoked from network); 23 Jun 2004 07:02:09 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 23 Jun 2004 07:02:09 -0000 Received: (qmail 28233 invoked from network); 23 Jun 2004 07:01:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jun 2004 07:01:32 -0000 Received: (qmail 17572 invoked by alias); 23 Jun 2004 07:01:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7590 Received: (qmail 17555 invoked from network); 23 Jun 2004 07:01:08 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 23 Jun 2004 07:01:05 -0000 Received: (qmail 27388 invoked from network); 23 Jun 2004 07:01:05 -0000 Received: from unknown (HELO moonbase.zanshin.com) (root@167.160.213.139) by a.mx.sunsite.dk with SMTP; 23 Jun 2004 07:01:03 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i5N711vK017749 for ; Wed, 23 Jun 2004 00:01:01 -0700 Date: Wed, 23 Jun 2004 00:01:01 -0700 (PDT) From: Bart Schaefer Sender: schaefer@toltec.zanshin.com Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: zsh completion of just latex files In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Tue, 22 Jun 2004, zzapper wrote: > In a directory full of latex files *.tex and all the *.toc *.dvi etc I > want a widget to only complete *.tex file eg > > vtex some_tex_file.tex > > How should I do this? Assuming (a) that you're using compsys rather than compctl and (b) that there isn't already a specialized completer for "vtex", the way to do this is with the zstyle mechanism, specifically the file-patterns style. The example in the manual is very similar to this: zstyle ':completion:*:*:vtex:*' file-patterns \ '*.tex:tex-files' '*.toc:toc-files *.dvi:dvi-files' '%p:all-files' This means to first try to complete tex files, then (simultaneously, note that the next two specs are both in the same string) toc or dvi files if there are no tex, and finally all files.