From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13489 invoked from network); 7 Oct 2005 09:08:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Oct 2005 09:08:57 -0000 Received: (qmail 4905 invoked from network); 7 Oct 2005 09:08:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Oct 2005 09:08:48 -0000 Received: (qmail 12573 invoked by alias); 7 Oct 2005 09:08:37 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9483 Received: (qmail 12562 invoked from network); 7 Oct 2005 09:08:36 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Oct 2005 09:08:36 -0000 Received: (qmail 3399 invoked from network); 7 Oct 2005 09:08:36 -0000 Received: from master.altlinux.ru (HELO master.altlinux.org) (62.118.250.235) by a.mx.sunsite.dk with SMTP; 7 Oct 2005 09:08:35 -0000 Received: from solemn.turbinal.org (localhost.localdomain [127.0.0.1]) by master.altlinux.org (Postfix) with ESMTP id 5A781E596C for ; Fri, 7 Oct 2005 13:08:32 +0400 (MSD) Received: by solemn.turbinal.org (Postfix, from userid 500) id 6584639D; Fri, 7 Oct 2005 13:08:28 +0400 (MSD) Date: Fri, 7 Oct 2005 13:08:28 +0400 From: Alexey Tourbin To: zsh-users@sunsite.dk Subject: Re: Problem writing ri completion function Message-ID: <20051007090828.GB3575@solemn.turbinal.org> References: <20051006164111.GA8382@portfolio16.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8X7/QrJGcKSMr1RN" Content-Disposition: inline In-Reply-To: <20051006164111.GA8382@portfolio16.de> X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 --8X7/QrJGcKSMr1RN Content-Type: multipart/mixed; boundary="kXdP64Ggrk/fb43R" Content-Disposition: inline --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 06, 2005 at 06:41:12PM +0200, Tobias Gruetzmacher wrote: > Hi, Hello, > I was writing a new completion for ri, the ruby documentation viewing BTW, I've got another _ri completion that was recently written by Sir Raorn. https://bugzilla.altlinux.org/show_bug.cgi?id=7593 Please take a look (I believe it is available under the same terms as zsh). --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="zsh-4.3.0-alt-comp-ri.patch" --- zsh-4.3.0-20050926/Completion/Unix/Command/_ri- 2005-09-25 22:18:51 +0000 +++ zsh-4.3.0-20050926/Completion/Unix/Command/_ri 2005-09-25 22:22:25 +0000 @@ -0,0 +1,24 @@ +#compdef ri + +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args + +_arguments \ + '(- *)'{-h,--help}'[print help information and exit]' \ + '(- *)'{-v,--version}'[display the version of ri]' \ + '(-c --classes)'{-c,--classes}'[display the names of classes and modules we know about]' \ + '(-d --doc-dir)'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \ + '(-f --format)'{-f,--format}'[format to use when displaying output]:output format:(ansi bs html plain simple)' \ + '(-l --list-names)'{-l,--list-names}'[list all the names known to RDoc]' \ + '(-T --no-pager)'{-T,--no-pager}'[send output directly to stdout]' \ + '(-w --width)'{-w,--width}'[set the width of the output]:output width:' \ + '*:ri name:->ri-name' && ret=0 + +if [[ "$state" = ri-name ]]; then + local ri_names expl + + ri_names=( ${(f)"$( _call_program ri-names "$words[1]" ${(v)opt_args[(I)(-d|--doc-dir)]:+-d "${(v)opt_args[(I)(-d|--doc-dir)]}"} -l -T )"} ) + _wanted ri-names expl "ri name" compadd -a ri_names && ret=0 +fi + +return $ret --kXdP64Ggrk/fb43R-- --8X7/QrJGcKSMr1RN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFDRjsMfBKgtDjnu0YRAu+wAKDKIQA32IeCU3/PTnjEcx6ryYgdowCZATVW ENdzc9DjgBAoTTbVh8ZZAzg= =2bGC -----END PGP SIGNATURE----- --8X7/QrJGcKSMr1RN--