zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: How to restart zle without invoking 'accept-line'?
Date: Mon, 04 Nov 2013 10:14:08 -0800	[thread overview]
Message-ID: <131104101408.ZM17080@torch.brasslantern.com> (raw)
In-Reply-To: <CAAq2XdpZnGBAn0zkyiuYFLsRRaMW2NLEUx37NEwxBqggUj2_hA@mail.gmail.com>

On Nov 3,  7:53pm, Thiago Padilha wrote:
} 
} I've tried to use the passthrough example from the keymap+widget tip you
} gave on the other thread:
} 
[...]
} 
} This works when I press enter(accept-line) but for ctrl+c I still need to
} press two times to restart zle.

I'm sorry, I hadn't fully comprehended that you were setting up to jump
directly into this from zle-line-init.

You can't actually restart zle from zle-line-init because, technically,
zle hasn't started *yet* at that point.  Send-break will interrupt
whatever zle-line-init is doing, but then you just fall on through to
the "instance" of zle that was already starting.

} If I bind 'recursive-edit-and-accept to a key and activate it outside
} zle-line-init, everything works as expected.

That is a clue to how you might make this work:

(1) bind recursive-edit-and-accept to a key string

(2) in zle-line-init, use "zle -U" to put that string on the input

This way, when zle-line-init ends, the first thing that will be run by
the editor is the command to switch to recursive-edit-and-accept.

By the way, you don't need to put the "zle -N ... end-recursive-edit"
inside the function body of recursive-edit-and-accept.  The zle -N may
be done just once, and keymap+widget will take care of the rest.


      reply	other threads:[~2013-11-04 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 11:30 Thiago Padilha
2013-10-30 15:31 ` Bart Schaefer
2013-11-03 21:53   ` Thiago Padilha
2013-11-04 18:14     ` Bart Schaefer [this message]

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=131104101408.ZM17080@torch.brasslantern.com \
    --to=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).