From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19625 invoked from network); 6 Oct 2005 16:41:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Oct 2005 16:41:35 -0000 Received: (qmail 45875 invoked from network); 6 Oct 2005 16:41:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Oct 2005 16:41:25 -0000 Received: (qmail 29123 invoked by alias); 6 Oct 2005 16:41:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9482 Received: (qmail 29112 invoked from network); 6 Oct 2005 16:41:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Oct 2005 16:41:17 -0000 Received: (qmail 44879 invoked from network); 6 Oct 2005 16:41:17 -0000 Received: from zoidberg.org (HELO cthulhu.zoidberg.org) (213.133.99.5) by a.mx.sunsite.dk with SMTP; 6 Oct 2005 16:41:14 -0000 Received: from kos-mos (d463c7cf.datahighways.de [::ffff:212.99.199.207]) (AUTH: PLAIN tobias, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by cthulhu.zoidberg.org with esmtp; Thu, 06 Oct 2005 18:41:13 +0200 id 038063A0.434553A9.00005F27 Date: Thu, 6 Oct 2005 18:41:12 +0200 From: Tobias Gruetzmacher To: zsh-users@sunsite.dk Subject: Problem writing ri completion function Message-ID: <20051006164111.GA8382@portfolio16.de> Mail-Followup-To: zsh-users@sunsite.dk Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_cthulhu.zoidberg.org-24359-1128616873-0001-2" Content-Disposition: inline User-Agent: Mutt/1.5.11 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_cthulhu.zoidberg.org-24359-1128616873-0001-2 Content-Type: multipart/mixed; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I was writing a new completion for ri, the ruby documentation viewing tool, when I came upon a small problem: ri takes as argument the full name of a class, module or method. It can generate a list of all documented functions, which I use to fill the completion list. This list is very long, so I tried to use _multi_parts to get a better overview. The problem is: ri uses different separators to differentiate between class method and instance methods. For example I have these alternatives: File (class or module) File::basename (class method) File.path (instance method) File::Stat (another class) File::Stat::new (another class method) I currently only use _multi_parts with "." as separator - I don't know enough zsh scripting to build something to use multiple separators. Any ideas? Greetings Tobi --=20 GPG-Key 0xE2BEA341 - signed/encrypted mail preferred My, oh so small, homepage: http://portfolio16.de/ http://www.fli4l.de/ - ISDN- & DSL-Router on one disk! Registered FLI4L-User #00000003 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_ri #compdef ri # # zsh completion for the ri ruby documentation tool # from http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/128677 # + some changes _ri () { _arguments -C -s \ '(-h --help)'{-h,--help}'[print help message]' \ '(-c --classes)'{-c,--classes}'[Display the names of classes and modules we know about]' \ '(-d --doc-dir)'{-d+,--doc-dir+}'[A directory to search for documentation]:directory:_files -/' \ '(-f --format)'{-f,--format}'[Format to use when displaying output]:format:(ansi bs html plain simple)' \ '(-l --list-names)'{-l,--list-names}'[List all the names known to RDoc, one per line]' \ '(-T --no-pager)'{-T,--no-pager}'[Send output directly to stdout]' \ '(-w --width)'{-w+,--width+}'[output width]:width: ' \ '(-v --version)'{-v,--version}'[Display the version of ri]' \ "*:help topics:_ri_names" } _ri_names () { if ( [[ ${+_ri_list_names} -eq 0 ]] || _cache_invalid ri_names ) && ! _retrieve_cache ri_names; then _ri_list_names=( ${$(_call_program ri--list-names RI= ri -l -T 2>/dev/null)//\#/.} ) _store_cache ri_names _ri_list_names fi _multi_parts -i "." _ri_list_names } _ri "$@" --sm4nu43k4a2Rpi4c-- --=_cthulhu.zoidberg.org-24359-1128616873-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDRVOnGf7YPOK+o0ERArnEAKCN672dFKa6Rk1KysQzg1eVa2y3GwCfRs5A GRAWZpGdKIHP/t65WcDP1Mo= =DNQV -----END PGP SIGNATURE----- --=_cthulhu.zoidberg.org-24359-1128616873-0001-2--