From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Cannot use LBUFFER+= nor print -zr from zsh/sched call
Date: Tue, 13 Sep 2016 17:44:58 +0200 [thread overview]
Message-ID: <CAKc7PVD93+km9wvqGD-4BXbhwjB=Sex=tyDJvGSD0EqzQ7VXSA@mail.gmail.com> (raw)
In-Reply-To: <160912103408.ZM25185@torch.brasslantern.com>
On 12 September 2016 at 19:34, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Sep 12, 5:24pm, Sebastian Gniazdowski wrote:
> }
> } The ZLE solution you gave is ok, but sched can start without zle == true
>
> Well, yes. It should be fine to do e.g.:
>
> if zle; then
> zle -U "${(j.;.)commands}"
> else
> print -zr "${(j.;.)commands}"
> fi
>
> If zle is not yet running, then it's going to start up the very next
> thing, and will pop the buffer stack onto the new command line.
>
> If you want an implicit accept-line, then you're going to have to do
> something to coordinate with zle-line-init in the "else" branch.
The zle-via-widget method works:
function __convey_zle_paster() {
zle .kill-buffer
LBUFFER+="$*"
zle .redisplay
zle .accept-line
}
zle -N __convey_zle_paster
Except it doesn't accept the buffer. I don't know how to coordinate
with zle-line-init, any hints maybe? And it will be hard to do with
print -zr.. So I include this method as option:
# To put commands on command line, Zconvey can use small program "feeder".
# Or "zsh" method, which currently doesn't automatically run the command – to
# use when e.g. feeder doesn't build (unlikely) or when occurring any problems
# with it
zstyle ":plugin:zconvey" output_method "feeder"
Best regards.
Sebastian Gniazdowski
next prev parent reply other threads:[~2016-09-13 17:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 9:28 Sebastian Gniazdowski
2016-09-11 10:35 ` Sebastian Gniazdowski
2016-09-12 1:13 ` Bart Schaefer
2016-09-12 15:06 ` Bart Schaefer
2016-09-12 15:24 ` Sebastian Gniazdowski
2016-09-12 17:34 ` Bart Schaefer
2016-09-13 15:44 ` Sebastian Gniazdowski [this message]
2016-09-13 16:55 ` Bart Schaefer
2016-09-13 17:29 ` Sebastian Gniazdowski
2016-09-14 1:47 ` Bart Schaefer
2016-09-14 5:13 ` Sebastian Gniazdowski
2016-09-12 0:58 ` Bart Schaefer
2016-09-12 8:49 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKc7PVD93+km9wvqGD-4BXbhwjB=Sex=tyDJvGSD0EqzQ7VXSA@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).