zsh-workers
 help / color / mirror / code / Atom feed
From: Dave Yost <Dave@Yost.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: shell script that replaces the command line
Date: Mon, 16 Jun 2014 21:31:35 -0700	[thread overview]
Message-ID: <F5683973-6BAD-4371-B86F-E38722A6BD66@Yost.com> (raw)
In-Reply-To: <140613150256.ZM5818@torch.brasslantern.com>

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Thanks.

vared will do.

http://yost.com/computers/d

Dave

On Fri 2014-06-13, at 03:02 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Jun 13,  2:34pm, Dave Yost wrote:
> }
> } but there must be a way to replace the current command line rather
> } than setting the contents of the next one, yes?
> 
> Not from outside a widget, no.  Only widget functions have access to
> the current editor state.
> 
> But I'm not clear on why you need to do so?  In your original example,
> the "d" function would just "print -z previously-backgrounded-command"
> and then exit, at which point a new prompt would appear and pop the
> buffer stack so you'd have "previously-backgrounded-command" sitting
> there ready to edit.
> 
> What part of the flow am I not seeing?
> 
> If what you want is for "d" to present a line for editing, wait for the
> editor, and then continue execution after the editor returns, then what
> you want is to call the "vared" command from "d".
> 
> example_d() {
>  local foo="echo this is the command to edit"
>  vared -e -h -p "Do your editing: " foo && eval $foo
> }
> 
> There are a bunch of options to vared to manipulate the state in which
> the editor starts/runs.


  reply	other threads:[~2014-06-17  4:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 23:07 Dave Yost
2014-06-13  6:40 ` Bart Schaefer
2014-06-13  7:22   ` Dave Yost
2014-06-13 21:34   ` Dave Yost
2014-06-13 22:02     ` Bart Schaefer
2014-06-17  4:31       ` Dave Yost [this message]
2014-06-14  9:45     ` Mikael Magnusson

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=F5683973-6BAD-4371-B86F-E38722A6BD66@Yost.com \
    --to=dave@yost.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).