zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Don't store ZLE_LINE_ABORTED in vared context
Date: Wed, 4 Mar 2015 20:46:28 -0800	[thread overview]
Message-ID: <150304204628.ZM20125@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3QbXZQqPJpd0Wxvx6pVjmCmiB=yQN5RmRfKXdbhUtCqnw@mail.gmail.com>

On Mar 5,  3:41am, Mikael Magnusson wrote:
} Subject: Re: PATCH: Don't store ZLE_LINE_ABORTED in vared context
}
} On Thu, Mar 5, 2015 at 2:57 AM, Bart Schaefer <schaefer@brasslantern.com> wrote:
} > } annoying if you set up a widget to do the up-line-or-aborted, because
} > } it will grab the vared text as a command then.
} >
} > Hrm, perhaps, but I believe the intent was to be able to hang on to
} > whatever buffer was most recently being edited when the interrupt came
} > through.
} 
} So how should I handle this case in my shell widget then?

Based on this:  http://www.zsh.org/mla/workers/2010/msg00702.html

I wonder if the solution is that zle-line-finish should be called even
when the editor is aborted with send-break.

However, you should be able to do something like

zle-line-init() {
  if [[ $LAST_CONTEXT = vared ]]
  then unset ZLE_LINE_ABORTED
  else : your thing with ZLE_LINE_SAVED
  fi
  LAST_CONTEXT=$CONTEXT
}

} I think pws introduced the feature so maybe he can clarify.

Look at http://www.zsh.org/mla/workers/2010/msg00681.html and then
http://www.zsh.org/mla/workers/2010/msg00685.html ...

> Hmm... I'm wondering if I put it in the right place.  sendbreak can abort
> other things than the full line edit, and I already claimed that "this
> parameter is set by the line editor when an error occurs", which as you
> spotted isn't necessarily true.

I think the intent was to capture "other things than the full line edit"
with ZLE_LINE_ABORT.  But yes, let PWS weigh in.


  reply	other threads:[~2015-03-05  4:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 18:40 Mikael Magnusson
2015-03-05  1:57 ` Bart Schaefer
2015-03-05  2:41   ` Mikael Magnusson
2015-03-05  4:46     ` Bart Schaefer [this message]
2015-03-05  9:59 ` Peter Stephenson
2015-03-05 13:58   ` Peter Stephenson
2015-03-06  9:52     ` Peter Stephenson
2015-03-06 16:05       ` 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=150304204628.ZM20125@torch.brasslantern.com \
    --to=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).