zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Add SHORT_KEYBIND_DISCARD option
Date: Thu, 7 Apr 2016 18:07:24 +0200	[thread overview]
Message-ID: <CAHYJk3R9etXZy1G4UfTBYTMH1M0Xo_xP0Lzw1wr5Otx=C7wfwA@mail.gmail.com> (raw)
In-Reply-To: <28148.1460042736@thecus.kiddle.eu>

On Thu, Apr 7, 2016 at 5:25 PM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Mikael Magnusson wrote:
>> > Didn't we discuss this issue a few months ago - have you perhaps got a
>> > message reference?
>
> I managed to find this again: users/20358 is a good reference where Bart
> makes the point that this will have unpredictable effects for an unbound
> function key. Some of the thread is in -workers.

I'm not sure what exactly is unpredictable about it. Pressing F1,
you'll see [11~ instead of just the ~. (this is assuming you have some
other F-key bound, if you don't, you'll see 1~ because there's less
common prefix, so you're arguing for something that is already very
inconsistent). I could buy this argument if we ignored the whole key
including the final ~ too, but we don't. In emacs mode it gives you
more hints about what key you actually pressed, and in vi mode, ^[ is
already bound to vi-cmd-mode so the patch doesn't affect this case (it
already caseswaps 11 characters and leaves the user wondering wtf
happened).

> We could make discarding the keys conditional upon whether KEYTIMEOUT
> has elapsed since the prefix was received to account for that, however.
>
>> 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.
>
> If get a prefixed key combination wrong, a beep seems cleaner than
> getting the latter part inserted.

People do things like bindkey -M viins jj vi-cmd-mode, but i'm sure
they still like to type words beginning with a j. (This works already
because j isn't undefined-key though).

You do have a point for things like ^X^D type stuff though, if I don't
have that bound maybe I don't want to accidentally close the shell.
(For weird people that don't use ignoreeof). :)

In my favor though, consider pressing alt-up from zsh -f in emacs
mode. Without the change, it will beep and insert [A, and with the
change it will beep (from the single escape), and then invoke the
up-line-or-history binding of the up key. That's better, arguably.

>> It just seems like a much more correct way of doing it to me.
>
> But is it also proving an irritation in actual practice? Are you often
> typing part of a long emacs-style binding and then being distracted by
> something in another window, perhaps?

I suppose it isn't.

> Would a separate timeout after which a prefix is discarded perhaps make sense?

I've sometimes harbored thoughts about allowing per-prefix timeouts even :).



Overall, I guess I'm a little bit less decided now than when I started
the thread.

-- 
Mikael Magnusson


      reply	other threads:[~2016-04-07 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-03  4:41 Mikael Magnusson
2016-04-06 14:33 ` Oliver Kiddle
2016-04-06 18:06   ` Mikael Magnusson
2016-04-06 19:25     ` Bart Schaefer
2016-04-07 15:25     ` Oliver Kiddle
2016-04-07 16:07       ` Mikael Magnusson [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='CAHYJk3R9etXZy1G4UfTBYTMH1M0Xo_xP0Lzw1wr5Otx=C7wfwA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=okiddle@yahoo.co.uk \
    --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).