From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27175 invoked by alias); 27 Oct 2010 05:01:37 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28369 Received: (qmail 3925 invoked from network); 27 Oct 2010 05:01:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101026220102.ZM29774@torch.brasslantern.com> Date: Tue, 26 Oct 2010 22:01:02 -0700 In-reply-to: <20101026161947.19279c58@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: accept-line-and-down-history and push-input" (Oct 26, 4:19pm) References: <101026075546.ZM28500@torch.brasslantern.com> <20101026161947.19279c58@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: zle_line_init_functions (Re: accept-line-and-down-history and push-input) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [>workers] On Oct 26, 4:19pm, Peter Stephenson wrote: } Subject: Re: accept-line-and-down-history and push-input } } On Tue, 26 Oct 2010 07:55:44 -0700 } Bart Schaefer wrote: } > (I'm beginning to think that zle-line-init should be a builtin widget } > that calls an array of hook functions, ala precmd.) } } I've been thinking along those lines, except that the array of hook } functions would be the alternative to the widget, as with chpwd and } friends I don't much like the idea of having an array of *widget names*. What's the benefit of invoking a series of widgets, rather than having one widget that calls a series of functions? The context is the same either way (i.e., "zle" with no args returns zero status and you can access all the line editor variables) and all the work of creating and destroying thingys can be avoided. } i.e. you could still define zle-line-init if you wanted a } simple life but zle_line_init_functions could contain an additional set } of widgets. Wouldn't you still get that effect if zle-line-init was a builtin widget that you could override with your own via zle -N ? } Not sure how to keep the name of the array entirely within zle I don't know what you're reaching for, there. The array has to be outside of zle at some point or you can't assign anything to it ...? zle-line-init() { local f for f in $zle_line_init_functions do if [[ $PWS_users_15493 ]] then zle "$f" elif [[ $my_suggestion ]] then "$f" || break fi done }