From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6636 invoked by alias); 2 Apr 2015 20:58:51 -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: 20069 Received: (qmail 15771 invoked from network); 2 Apr 2015 20:58:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=8XA1rFnlm5MSHVExl1xuhKTDiggji20MaQL/i51lCHA=; b=wHwAc2rnGlp8pHcxqBogqVj4a25EcE9WEnQ9B5Kq6PVqLJWxXfw/ERJyQXjp0S6m06 UYV9NvQsWWD3MZHe2T/IhAmHva6faomizi4QMQM2nOIVOwZGjh/u7icylctMRMCB3vfp rTLnmov4bjWlMuixI81N+hb4JBqx+BTiHe1oRMGCkEa3NAT2QMOVyOAIkU5mqgq9Nno9 MyiCrg5bTfH4yNRFm/yO0EkzmSawn2PheADTpXjLhua8Xscr5OcziP1SFoU8CaymS6K1 9gp1Cd95kVz8kYOagRT5C3UM/l7DwvE8pmTRs+CZbNppHb4jL2sXzxehILbv9FSQhb1K 6nHg== MIME-Version: 1.0 X-Received: by 10.43.14.199 with SMTP id pr7mr83232852icb.3.1428008313261; Thu, 02 Apr 2015 13:58:33 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Apr 2015 22:58:33 +0200 Message-ID: Subject: Re: accept-line question From: Mikael Magnusson To: Dave Yost Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Apr 2, 2015 at 7:12 PM, Dave Yost wrote: > Sorry, that email was flawed. Let me try again. > > Below, after sourcing a script, I type ^a then ^b. > The ^a works as expected, but not the ^b > > There must be something more I have to do besides =E2=80=9Caccept-line=E2= =80=9D. But what? > > 0 Thu 9:59:38 yost DaveBook ~ > 206 Z% cat accept-line-test.zsh > function xxx { > BUFFER=3D"$1" > zle -R > zle accept-line > } > > function x1 { > xxx echo\ 1 > } > > function x2 { > xxx echo\ 2 > xxx echo\ 3 > } > > zle -N x1 > zle -N x2 > > bindkey ^a x1 > bindkey ^b x2 > 0 Thu 9:59:47 yost DaveBook ~ > 207 Z% source accept-line-test.zsh > 0 Thu 9:59:54 yost DaveBook ~ > 208 Z% echo 1 > 1 > 0 Thu 9:59:55 yost DaveBook ~ > 209 Z% echo 3 > 3 > 0 Thu 9:59:59 yost DaveBook ~ > 210 Z% > > The output I want from ^b is > > 0 Wed 0:30:03 yost DaveBook ~ > 240 Z% echo 2 > 2 > 0 Wed 0:30:04 yost DaveBook ~ > 241 Z% echo 3 > 3 > 0 Wed 0:30:04 yost DaveBook ~ > 242 Z% > > Extra credit: > > Is there a way to write a function x3 that calls x2, such that I can issu= e x3 from the command line get the result above instead of the result below= ? > > 0 Thu 10:04:32 yost DaveBook ~ > 216 Z% x2 > xxx:zle:3: widgets can only be called when ZLE is active > xxx:zle:3: widgets can only be called when ZLE is active > 1 Thu 10:05:55 yost DaveBook ~ > 217 Z% AFAICT, Bart's answer still applies to the above, so just read that again. --=20 Mikael Magnusson