From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16981 invoked from network); 29 Jan 2004 12:31:12 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 29 Jan 2004 12:31:12 -0000 Received: (qmail 358 invoked by alias); 29 Jan 2004 12:30:45 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7026 Received: (qmail 344 invoked from network); 29 Jan 2004 12:30:44 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 29 Jan 2004 12:30:44 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 29 Jan 2004 12:30:43 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i0TCUgv19697 for ; Thu, 29 Jan 2004 12:30:42 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 29 Jan 2004 12:30:28 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 29 Jan 2004 12:30:49 +0000 To: Zsh Users Subject: Re: binding key sequence to command and accept-line In-reply-to: "Eric Smith"'s message of "Thu, 29 Jan 2004 11:50:34 +0100." <20040129105034.GA27919@fruitcom.com> Date: Thu, 29 Jan 2004 12:30:41 +0000 Message-ID: <19432.1075379441@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 29 Jan 2004 12:30:49.0158 (UTC) FILETIME=[B9E6FE60:01C3E663] Eric Smith wrote: > How would I with a key sequence like for example r > print a file? viz. > > $ somefile.ps > ` r' > $ lpr somefile.ps Old-style (pre zsh-4): bindkey -s '^alpr \n' Probably good enough, although it assumes emacs bindings (the ^a in particular). New-style: lpr-line() { LBUFFER="lpr $LBUFFER" zle accept-line } zle -N lpr-line bindkey '\er' lpr-line More flexible but otherwise pretty much the same. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************