Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc;
        bh=CkCHCPco2U5ZdhtD33AAs3ceBSfVmhF4vE0er/BPEWk=;
        b=VMBba+EFNRkr5y5Z3rglWbP+YwRU0qq0M+HxXgkXY5Nf3lNEZn1lhjJflZiNu0oVts
         B1TD9Y13tXksoKHzgeR3RubrJ/ju8nmDzLR6fO5Plb8f8ltkWqjSbheteC9s02owP3ea
         2tUPAxVAGjyWN9h4qpu9dmbpbdira4OM26lchLtar25es2PMs0ZRUE/UMbDb4ol5OtEy
         GJWGZLasUcQO9v2n/1ESGtzZqSaZwOiIRmxzDIqdJjbDCLnvccYUqsW0XECsOgaGmQuT
         XQBUF4rYkCqBpyIdz2QwJPBGA7ccZ7Y1t2/kXAeLycJlH5HUBlXKIqer7g27AhNLgLrg
         LKOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc;
        bh=CkCHCPco2U5ZdhtD33AAs3ceBSfVmhF4vE0er/BPEWk=;
        b=ZOshJS4kvE4IeHczA6jchUjx5mfMCdE9pylAHh14x4YySZsei8ncdbIvC/IRDnC6to
         bqFfLW3pE9UrgpnHBboksf0kl1p4hFh8dvUkzaq5DUvH2C7ixs7GNAJkTiQ7mTQ82Kda
         XAJBI5eJ5X2iBXiIP9mHJySlyzk00b20Uunvlgx8TWC+p7do9ztos3nLUzO3/DxNdSus
         c5a75rYABvFfs4uesYWjxmwALuQvPZxybD568tcoHa6HaPIhquP4kh3FcO75WL+NbLXf
         XSR6z5kq/C0A8zIOm5qUKkhKkofvYEQsRg59o+rHDcbWopG6OkowPok2I7neHsJ9zHIk
         3K2g==
X-Gm-Message-State: AD7BkJJ9CbOjBX2/fgoeK9+ZNpgY3ImlA91YcUYF7UYmYI3qPsFolDj1/ZriPWG3BZuv+s+d1uLV2pTRS2vJRQ==
MIME-Version: 1.0
X-Received: by 10.140.27.132 with SMTP id 4mr55228268qgx.6.1459965973532; Wed,
 06 Apr 2016 11:06:13 -0700 (PDT)
In-Reply-To: <24571.1459953207@thecus.kiddle.eu>
References: <1459658514-24610-1-git-send-email-mikachu@gmail.com>
	<24571.1459953207@thecus.kiddle.eu>
Date: Wed, 6 Apr 2016 20:06:13 +0200
Message-ID: <CAHYJk3Q6aWvDL1nkcv0Ar9DSnwP2+i3Ze3DxdjDtVE3ttttymA@mail.gmail.com>
Subject: Re: PATCH: Add SHORT_KEYBIND_DISCARD option
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38247

On Wed, Apr 6, 2016 at 4:33 PM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> On 3 Apr, Mikael Magnusson wrote:
>> Not sure how popular this option would be, but I'm fine with keeping
>> it local too. Basically when we encounter an undefined key, instead
>> of discarding the entire common prefix, we discard only one byte and
>> try again. In most particular, it means if you happen to press escape
>> or ctrl-x before pasting, we still properly detect the bracketed-paste
>> starting code.
>
> As a local fix, wouldn't simply binding the start code with each prefix
> serve your purposes?

For just making bracketed-paste work, yeah.

> Didn't we discuss this issue a few months ago - have you perhaps got a
> message reference? I haven't had the impression that it is bothering a
> lot of people. And even without bracketed-paste, a prefix followed by a
> paste is likely to have had undesirable results.

I think I asked if doing what this patch does was possible, but I want
it in general, not only because of bracketed-paste. If it were up to
me, this way would be the only way. It doesn't really make any sense
to me why we arbitrarily eat input just because it was a potential
common prefix that then turned out to not be part of any actual
keybinding. But since zsh people tend to like their things not
changing, I did the option.

I actually think it was so long ago I asked that the reason was we
didn't have bracketed-paste in core yet, and the weird multi-eating
meant you couldn't actually safely paste anything, because the evil
input could end in a potential prefix, and the bindkey -M paste stuff
wouldn't detect the end-paste code.

It just seems like a much more correct way of doing it to me.

> ZLE-specific stuff should ideally not leak into the base shell options.

Not sure what this is about, there are 113 calls to isset() in Src/Zle/*

> Or we're you actually hoping to stimulate thoughts on other solutions:
> perhaps a callback could be added like zle-keymap-select so you could
> change the cursor shape or prompt after a prefix.

Well, I want only one character to be eaten (or rather, only
characters that individually are "undefined-key"), rather than the
whole 'not actually a prefix'. That's my end goal. I guess I don't
currently have any super compelling arguments for it other than "it
seems much more correct".

Maybe I'm overestimating the amount of people depending on the current
behavior, and you would be more open to just changing the behavior
without adding any option? In the end, I can definitely live with the
patch being rejected though.

-- 
Mikael Magnusson

