From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25029 invoked from network); 17 Sep 2003 19:38:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Sep 2003 19:38:54 -0000 Received: (qmail 11733 invoked by alias); 17 Sep 2003 19:34:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19098 Received: (qmail 11721 invoked from network); 17 Sep 2003 19:34:01 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Sep 2003 19:34:01 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [217.174.194.138] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Sep 2003 19:34:1 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id h8HJXsi25167; Wed, 17 Sep 2003 21:33:55 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <19zi6v-00004k-00>; Wed, 17 Sep 2003 21:37:09 +0200 Date: Wed, 17 Sep 2003 21:37:09 +0200 From: DervishD To: Bart Schaefer Cc: Zsh Subject: Re: Tags in function files Message-ID: <20030917193709.GA283@DervishD> Mail-Followup-To: Bart Schaefer , Zsh References: <20030916203559.GA2160@DervishD> <18188.1063784897@gmcs3.local> <20030917083752.GC4415@DervishD> <1030917163041.ZM5852@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1030917163041.ZM5852@candle.brasslantern.com> User-Agent: Mutt/1.4i Organization: Pleyades User-Agent: Mutt/1.4i Hi Bart :)) Thanks a lot for your exhaustive answer, I've learned a lot :) * Bart Schaefer dixit: > } OK, thanks :) BTW, the special parameters as 'words' and the > } like, are too created and initialized by compinit (I mean, the new > } completion system...)? > No, those are set up by the ZLE internals. However, they're provided > only to "completion widgets", which means those created with "zle -C" > (as opposed to those created with "zle -N"). OK, now all makes sense. I was testing with a dummy widget (NOT a completion one...) and I was able to use 'zle complete-word' inside my widget, but I couldn't use '$words' (it expanded to nothing). On the other hand, I created a dummy completion widget with zle -C but then I wasn't able to use the predefined widgets inside. Namely something like this: my_comp () { zle .complete-word } zle -C dummycomp complete-word my_comp bindkey "^O" dummycomp When I hit '^O' zsh complains: my_comp:zle:1: widgets can only be called when ZLE is active Is this intended or am I totally clueless? I mean, instead of using compadd, I would like to be able to last-resort to some predefined completion widget, or even call some zle widget to move the cursor, retrieve the story, clean the command line, etc... That is, using some of the zle facilities inside my completion widget. > The new completion system I really like your suggestion, let's call it compsys ;))) > is an extensive example of what can be > accomplished with "zle -C" plus the "compadd" builtin. I've been reading some of the functions: compinit, compadd, some of the _* functions, etc... It's a very good job, truly. I'm amazed... > Then for finer control you can get into playing with the values of > the "compstate" parameter. You probably got all that already from > PWS's user guide, intro to chapter 6. I've read the entire guide, since it seems to be pretty valid (only minor differences with my version of zsh). In fact I've learned a lot of zsh, not only completions, but globbing, parameter expansion, zle, etc... The guide is great. Now I feel like I can go for the Zsh manual ;))) In the interim I'm reading the FAQ. > } $words doesn't seem to work, so I'm thinking about using 'BUFFER' for > } command line parsing in order to call one of the completion functions > } I need. Like _main_complete, but lots simpler. > Keep in mind that one of the things _main_complete does is reset a whole > lot of setopts to be sure that all completion functions operate in the > same syntactic environment. Oh, yes, I know, but I just want to learn and make some completions work in my box. I will try my best to set the options so if I made a change it doesn't affect the completions. > If, for example, you setopt KSH_ARRAYS, then > the behavior of things like $words won't match the compsys documentation. My problem with the compsys documentation is that I don't know which parameters, tags and the like are defined by compsys and which ones are controled by Zsh guts ;)) I'm learning, slowly but surely ;) > A handy debugging tool for widgets of any sort is "zle -M". E.g.: THANKS!!!! That's nice! Thanks again for your kind answer. This is a difficult issue for me and I really don't have all the time I would like to put it on learning Zsh, and your help is very valuable. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/