From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22903 invoked from network); 4 Oct 2000 16:03:33 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Oct 2000 16:03:33 -0000 Received: (qmail 16672 invoked by alias); 4 Oct 2000 16:03:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12889 Received: (qmail 16665 invoked from network); 4 Oct 2000 16:03:17 -0000 From: "Bart Schaefer" Message-Id: <1001004160312.ZM22931@candle.brasslantern.com> Date: Wed, 4 Oct 2000 16:03:12 +0000 In-Reply-To: <200010040954.LAA09415@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH: _rlogin splits up into three functions (still one file)" (Oct 4, 11:54am) References: <200010040954.LAA09415@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: _rlogin splits up into three functions (still one file) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 4, 11:54am, Sven Wischnowsky wrote: } } Bart Schaefer wrote: } } > #compdef krlogin krsh krcp } > compdef ${words[1]:t:s/k/_/} ${words[1]:t} } > _rlogin "$@" I just realized that the above won't work properly unless one of the k* forms is the first thing completed. If _rlogin has already been auto- loaded, call to _rlogin there is wrong. It could be written [[ $functions[_rlogin] == "builtin autoload -X" ]] && _rlogin "$@" || $_comps[${words[1]:t}] "$@" or some such, but that's pretty silly. So ... } This gave me the idea of adding one more (probably optional, i.e. not } used everywhere) level of indirection when mapping a command name to a } completion function. So that _rlogin could offer the `services' } `_rlogin', `_rsh' and whatnot. This actually sounds like a reasonable idea. There'd have to be a way for the #compdef tag line to register all the "services" provided by the file in which the tag appears. I still don't see any obvious way to fully automate this part -- } > +[[ $_comps[rsh] == _rlogin ]] && compdef _rsh rsh } > +[[ $_comps[remsh] == _rlogin ]] && compdef _rsh remsh } > +[[ $_comps[rcp] == _rlogin ]] && compdef _rcp rcp -- but I haven't been thinking about it for very long. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net