Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: accept-line question
- X-seq: zsh-workers 34839
- From: Dave Yost <Dave@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: accept-line question
- Date: Thu, 2 Apr 2015 10:12:04 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:mime-version:subject:in-reply-to:date :sendlaterdate:message-id:references:to; bh=ezvDvaPGPKc9K6b/rJ+Wmoz58Vumkr5G3g24enoLEbw=; b=EkSa2/QWRHJ3Fjt5qahbjfPENuN0HK2quTy0MMB3O7CZhmn+J702vnkL8U0WyX+pic JGRTfFgywTomCNf9A0ioRUgCbICdCmhGiueSm0splLmDMzM+V3+GEPt3L5Q6uWjyYJQR KJs6+GdIlO5kIBBRVL2M3cLUknwESEvi+9rMcwD1dVk7/EhLmcX+4p0ihgvx88VaOa5x c5RzR3h1DC/SdpQLLYWGVhptKZh+qWpVrXpkyqvhkYZpxJKnvMFfEHX3T5SceynFG/fM yNVYTyQ6cAnctCyO4ifD+JENTIvenULL+PPZhQ+tLQuz5xHzzYE4fBgf1HqZXZ9b25RL hITQ==
- In-reply-to: <FF62FDC6-BDD8-4BF3-AD44-F36E834D3B4F@yost.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <FF62FDC6-BDD8-4BF3-AD44-F36E834D3B4F@yost.com>
- Sender: Dave Yost <daveyostcom@xxxxxxxxx>
- Sendlaterdate: Thu, 2 Apr 2015 10:12:04 -0700
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 “accept-line”. But what?
0 Thu 9:59:38 yost DaveBook ~
206 Z% cat accept-line-test.zsh
function xxx {
BUFFER="$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 issue 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%
Thanks
Messages sorted by:
Reverse Date,
Date,
Thread,
Author