From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16798 invoked from network); 8 Jul 2005 01:25:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Jul 2005 01:25:12 -0000 Received: (qmail 25126 invoked from network); 8 Jul 2005 01:25:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Jul 2005 01:25:03 -0000 Received: (qmail 10098 invoked by alias); 8 Jul 2005 01:24:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9053 Received: (qmail 10089 invoked from network); 8 Jul 2005 01:24:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Jul 2005 01:24:54 -0000 Received: (qmail 24006 invoked from network); 8 Jul 2005 01:24:54 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 8 Jul 2005 01:24:50 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IJA00BXKBX9Y1M2@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Thu, 07 Jul 2005 20:24:46 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j681Oj06015814 for ; Thu, 07 Jul 2005 18:24:45 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j681OiSX015813 for zsh-users@sunsite.dk; Thu, 07 Jul 2005 18:24:45 -0700 Date: Fri, 08 Jul 2005 01:24:44 +0000 From: Bart Schaefer Subject: Re: Adding a prefix to certain filename completions In-reply-to: <20050707105817.GA5452@puritan.pnetwork> To: zsh-users@sunsite.dk Message-id: <1050708012444.ZM15812@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050705172846.GB5362@puritan.pnetwork> <20050704193711.GF6330@puritan.pnetwork> <20050705042324.GA21301@picard.franken.de> <20050705080946.GC5333@puritan.pnetwork> <1050706050022.ZM13972@candle.brasslantern.com> <20050706113154.GA5313@puritan.pnetwork> <20050707020210.GA5084@puritan.pnetwork> <1050707054007.ZM14965@candle.brasslantern.com> <20050707105817.GA5452@puritan.pnetwork> Comments: In reply to Nikolai Weibull "Re: Adding a prefix to certain filename completions" (Jul 7, 12:58pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Jul 7, 12:58pm, Nikolai Weibull wrote: } } I don't want to push it back at you, but perhaps your mail client is } being fooled by the mime-type of the second attachment (which was } us-ascii). Not much point in discussing this further ... my mail client normally won't display a body part at all if it doesn't recognize the character set. And other messages from you have been just fine ... so I'm not sure what's going on there. I've already deleted it, so I can't check it now. } Done. I modified the function a bit to handle files named + a bit } better: I'm not sure this is better. Previously you should have seen the explanation of 'line number' on the first tab, and then been able to complete the file name on the second tab. With your change, you'll never see the 'line number' message, it'll always complete the file. But if that's the behavior you wanted, this would be a better way: _vim_files () { case $PREFIX in (+*) _files -P './' $* && return 0 ;; (*) _files $* ;; esac case $PREFIX in (+) _message -e 'start at given line (default: end of file)' ;; (+<->) _message -e 'line number' ;; esac } Oh, one other thing ... having _vim_files embedded in the file named _vim in that way, causes _vim_files to be redefined as a function every time the _vim function is *called*. I should have noticed that before. See something like _cvs for an example of defining multiple functions in the same file.