From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3144 invoked from network); 11 Jul 2005 00:52:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Jul 2005 00:52:54 -0000 Received: (qmail 35554 invoked from network); 11 Jul 2005 00:52:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Jul 2005 00:52:48 -0000 Received: (qmail 23359 invoked by alias); 11 Jul 2005 00:52:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21423 Received: (qmail 23349 invoked from network); 11 Jul 2005 00:52:45 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Jul 2005 00:52:45 -0000 Received: (qmail 35258 invoked from network); 11 Jul 2005 00:52:45 -0000 Received: from iron.cat.pdx.edu (131.252.208.92) by a.mx.sunsite.dk with SMTP; 11 Jul 2005 00:52:41 -0000 Received: from ruby.cat.pdx.edu (ruby.cat.pdx.edu [131.252.208.85]) by iron.cat.pdx.edu (8.13.1/8.13.1) with ESMTP id j6B0qK9d020541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 10 Jul 2005 17:52:25 -0700 (PDT) Received: from ruby.cat.pdx.edu (localhost.localdomain [127.0.0.1]) by ruby.cat.pdx.edu (8.13.1/8.12.10) with ESMTP id j6B0qIFx000564 for ; Sun, 10 Jul 2005 17:52:18 -0700 Received: (from tspencer@localhost) by ruby.cat.pdx.edu (8.13.1/8.13.1/Submit) id j6B0qHTs000563 for zsh-workers@sunsite.dk; Sun, 10 Jul 2005 17:52:17 -0700 Date: Sun, 10 Jul 2005 17:52:17 -0700 From: Travis Spencer To: zsh-workers@sunsite.dk Subject: Re: PATCH: _unexpand Message-ID: <20050711005217.GB12208@ruby.cat.pdx.edu> Reply-To: zsh-workers@sunsite.dk Mail-Followup-To: zsh-workers@sunsite.dk References: <20050710061443.GA12208@ruby.cat.pdx.edu> <1050710162010.ZM24203@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050710162010.ZM24203@candle.brasslantern.com> User-Agent: All mail clients sucks. This one just sucks less. X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.2 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.2 On Sun, Jul 10, 2005 at 04:20:10PM +0000, Bart Schaefer wrote: > Try "unset _cmd_variant" right after you change your path, to clear the > _pick_variant cache. Ya, that did it. I guess the use of _pick_variant will work, but IMO rehash should invalidate the cache that _pick_variant is hanging onto. I've aliased rehash to `rehash && unset _cmd_variant', so I don't get bit by that one again. Here is a patch that uses _pick_variant instead: --- /dev/null Sun Jul 10 17:44:10 2005 +++ Completion/Unix/Command/_unexpand Sun Jul 10 17:32:36 2005 @@ -0,0 +1,42 @@ +#compdef unexpand +# +# $Id:$ +# +# Copyright (C) 2005 Travis L. Spencer +# ALL RIGHTS RESERVED +# +# See the file LICENCE in the root of the zsh distribution for +# licensing information. +# + +local all tabs ret=1 +local -a args + +all="convert all whitespace, instead of just initial whitespace" +tabs="use comma separated list of tab positions" +args=( + "(--all)-a[$all]" + "(--tabs)-t[$tabs]:tablist" + "*:file:_files" +) + +if _pick_variant gnu="Free Soft" unix --version; then + args+=( + "(-a)--all[$all]" + "--first-only[convert only leading sequences of whitespace]" + "(-t)--tabs=[$tabs]:tablist" + "(* -)--help[display help message and exit]" + "(* -)--version[output version information and exit]" + ) +fi + +_arguments "$args[@]" && ret=0 + +return ret + +: <