From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6177 invoked by alias); 2 Aug 2011 15:55:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16192 Received: (qmail 25671 invoked from network); 2 Aug 2011 15:55:13 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 2 Aug 2011 16:55:03 +0100 From: Peter Stephenson To: Subject: Re: zle insert problems Message-ID: <20110802165503.219861fc@pwslap01u.europe.root.pri> In-Reply-To: <4E38178A.9050406@gmx.net> References: <4E380791.2090807@gmx.net> <4E380FF2.3020309@gmx.net> <4E38178A.9050406@gmx.net> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.103.11.26] X-Scanned-By: MailControl A-12-00-01 (www.mailcontrol.com) on 10.71.0.135 On Tue, 2 Aug 2011 17:28:10 +0200 Pascal Wittmann wrote: > On 08/02/2011 05:09 PM, J=C3=A9r=C3=A9mie Roquet wrote: > > replace-pacman-command() { > > BUFFER=3D${BUFFER/pacman [-a-zA-Z]#/pacman $@} > > } > >=20 >=20 > Thanks, this is quite readable! >=20 > I'll take this solution but just to have a explicit no: There is no way > doing this only via zle? That's not really a meaningful question. It's not possible to do it via zle *commands*, no, but the whole point of having the zle variables is some things are best done that way rather than by commands. In other words, what you were trying to do as a zle command to insert a string at the cursor position is actually written as: LBUFFER+=3D"string" This is still using zle; it's basically equivalent to the non-existent command zle insert-string "string" but much more flexible. --=20 Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, = UK Member of the CSR plc group of companies. CSR plc registered in England and= Wales, registered number 4187346, registered office Churchill House, Cambr= idge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http= ://twitter.com/CSR_PLC and read our blog at www.csr.com/blog