zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Don't store ZLE_LINE_ABORTED in vared context
Date: Thu, 05 Mar 2015 09:59:44 +0000	[thread overview]
Message-ID: <20150305095944.5bce20ab@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAHYJk3TOafzzcfxE5A72MSumEZFasi95+5-AbRkpHPXKDhCt+w@mail.gmail.com>

On Wed, 4 Mar 2015 19:40:03 +0100
Mikael Magnusson <mikachu@gmail.com> wrote:
> send-break (^G ESC-^G) (unbound) (unbound)
>        Abort  the current editor function, e.g. execute-named-command, or the
>        editor itself, e.g. if you are in vared. Otherwise abort  the  parsing
>        of the current line; in this case the aborted line is available in the
>        shell variable ZLE_LINE_ABORTED.
> 
> However, pressing ctrl-c inside vared stores whatever was being edited
> in ZLE_LINE_ABORTED, which the above seems to imply should not happen.
> The following adjusts the code accordingly. It was actually a bit
> 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.

I'm not really sure I decided clearly one way or the other which was
likely to be better, so it's more a matter for experience rather than
the original intention.  I do seem to have been fairly deliberate with
the documentation, though; the "otherwise" doesn't seem to leave much
doubt.

Having the variable set in special cases is a bit of a headache, I
agree, since you don't necessarily know they're there, even if there are
ways round.

It would be tempting to have a different variable for the vared case
such as ZLE_VARED_ABORTED.

pws


  parent reply	other threads:[~2015-03-05 10:10 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
2015-03-05  9:59 ` Peter Stephenson [this message]
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=20150305095944.5bce20ab@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).