From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28868 invoked from network); 30 Aug 1999 14:21:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Aug 1999 14:21:26 -0000 Received: (qmail 2922 invoked by alias); 30 Aug 1999 14:19:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7547 Received: (qmail 2904 invoked from network); 30 Aug 1999 14:19:56 -0000 Message-Id: <9908301153.AA17018@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: some notes on 3.1.6 In-Reply-To: "Sven Wischnowsky"'s message of "Thu, 19 Aug 1999 13:23:37 DFT." <199908191123.NAA18221@beta.informatik.hu-berlin.de> Date: Mon, 30 Aug 1999 13:53:07 +0200 From: Peter Stephenson Sven Wischnowsky wrote: > .. but requiring that all > widgets they want to bind have to be defined by the user first is a > bit too much, I think But they don't have to be defined first. % bindkey '^[OS' foobar % bindkey '^[OR' whatever % foobar() { whatever() { LBUFFER="${LBUFFER}x" }; zle -N whatever; } % zle -N foobar works as expected (S-F12 then S-F11 on my keyboard adds an 'x', without `whatever' being defined when I bound it. Unless I've missed the point. > The > AUTO_PARAM_SLASH problem was already mentioned (the problem is that we > made such parameter completions be handled almost completely in shell > code, so we would have to add the slashes there, too, which is a bit > slowish). I've actually been doing the following and it's not so bad (it doesn't actually use the option). Maybe it could just blindly use the option, as long as we mention the fact that it may be slow. Maybe there's a way of enhancing compadd to get it to work easily: some form of the -f option which takes an array argument giving to the actual files to test instead of using the normal arguments? #compdef -parameter- setopt localoptions extendedglob local p pms dirlist normlist #pms=(${${${${(f)"$(typeset +)"}:#*local *\=*}##* }:/^$PREFIX*$SUFFIX}) _parameters -O pms for p in $pms; do if [[ -d ${(P)p} ]]; then dirlist=($dirlist $p) else normlist=($normlist $p) fi done (( #dirlist )) && compadd -S / -q $dirlist (( #normlist )) && compadd $normlist -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy