From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3362 invoked from network); 17 Aug 2004 21:30:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Aug 2004 21:30:20 -0000 Received: (qmail 67824 invoked from network); 17 Aug 2004 21:30:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Aug 2004 21:30:13 -0000 Received: (qmail 7781 invoked by alias); 17 Aug 2004 21:29:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7875 Received: (qmail 7770 invoked from network); 17 Aug 2004 21:29:29 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 17 Aug 2004 21:29:29 -0000 Received: (qmail 66242 invoked from network); 17 Aug 2004 21:27:31 -0000 Received: from unknown (HELO moonbase.zanshin.com) (167.160.213.139) by a.mx.sunsite.dk with SMTP; 17 Aug 2004 21:27:28 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i7HLRRrQ025691 for ; Tue, 17 Aug 2004 14:27:27 -0700 Date: Tue, 17 Aug 2004 14:27:27 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: ZSH User List Subject: Re: how to execute zle widget during zsh-init? In-Reply-To: <20040817162221.GA1472@spiegl.de> Message-ID: References: <20040816214627.GA32476@spiegl.de> <20040817162221.GA1472@spiegl.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.9 required=6.0 tests=BAYES_30 autolearn=no version=2.63 X-Spam-Hits: -0.9 On Tue, 17 Aug 2004, Andy Spiegl wrote: > but zle-line-init() is called every time zle starts, i.e. before a prompt > is shown. Isn't that overkill? :-) That's why I put "zle -D zle-line-init" in there. The widget executes once (the first time zle initializes) and then ceases to be a widget, so it never executes again. > Besides that doubt I can't get it to work. I put the function > zle-line-init into my .zshrc, but where do I put the definition of the > function grow-killring? I presumed you had that somewhere already, because of the implementation you had included. I didn't know what you called it so I made up a name. I supposed e.g. that you had pasted in the content of an autoload file. The full solution (with apologies to others that this repeats most of my previous post) could all be in .zshrc and would then look something like grow-killring() { setopt localoptions noksharrays : ${killring[${NUMERIC:-30}]:=''} } zle -N grow-killring zle-line-init() { zle grow-killring zle -D zle-line-init } zle -N zle-line-init