From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28592 invoked from network); 12 Jun 2007 16:54:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=no version=3.2.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Jun 2007 16:54:17 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 54626 invoked from network); 12 Jun 2007 16:54:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Jun 2007 16:54:11 -0000 Received: (qmail 3274 invoked by alias); 12 Jun 2007 16:54:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11552 Received: (qmail 3265 invoked from network); 12 Jun 2007 16:54:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Jun 2007 16:54:02 -0000 Received: (qmail 53413 invoked from network); 12 Jun 2007 16:54:02 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 12 Jun 2007 16:53:58 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly15c.srv.mailcontrol.com (MailControl) with ESMTP id l5CGrtDE017952 for ; Tue, 12 Jun 2007 17:53:56 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Tue, 12 Jun 2007 17:53:54 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.8/8.13.4) with ESMTP id l5CGrsMq000593 for ; Tue, 12 Jun 2007 17:53:54 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l5CGrs3Y000590 for ; Tue, 12 Jun 2007 17:53:54 +0100 Message-Id: <200706121653.l5CGrs3Y000590@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: Calling a zle widget from a function In-reply-to: <20070612162322.GF12698@fsst.voodoo.lan> References: <20070612144404.GN14435@refinery.twat.com.ar> <200706121514.l5CFEaH5029180@news01.csr.com> <20070612162322.GF12698@fsst.voodoo.lan> Comments: In-reply-to Frank Terbeck message dated "Tue, 12 Jun 2007 18:23:22 +0200." Date: Tue, 12 Jun 2007 17:53:54 +0100 From: Peter Stephenson X-OriginalArrivalTime: 12 Jun 2007 16:53:54.0952 (UTC) FILETIME=[43108080:01C7AD12] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-07-10 (www.mailcontrol.com) on 10.67.0.125 Frank Terbeck wrote: > So, that means that (no matter if using v4.2 or v4.3) you cannot call > widgets from the commandline, right? >>From the *command line* you can: type Esc x and enter the name of the widget (or bind it with bindkey). From something executed as an ordinary piece of shell code from the command line, and in particular from a trap, you can't. > And how would you 'hook' into zle? I don't know what you meant by > that. You can redefine any standard widget to get it to execute your own code as well as its normal function. This is sometimes done with accept-line: accept-line() { my-code zle .accept-line } zle -N accept-line However, I don't think there's anything you can intercept when zle is idle. You can "kick" zle with "zle -I" from outside it to cause it to redisplay, but as far as I can see that doesn't go through any user-redefinable widgets. So that doesn't seem to help either. There are a limited number of "real" hooks (zle-line-init and zle-keymap-select), although I called them "special widgets" which wasn't a particular clever name, but neither of them helps here either. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview