zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zle -U "$selected" doesn't handle (some?) multibyte characters
Date: Sun, 10 Jan 2016 12:51:49 -0800	[thread overview]
Message-ID: <160110125149.ZM1234@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVADMeoR-9CjdhNRePNe_2Ymiz77Go+xUtbirCU9fT01pA@mail.gmail.com>

On Jan 10, 12:38pm, Sebastian Gniazdowski wrote:
}
} Is there any alternative to zle -U, to support older Zshells?

There's not really an alternative to "zle -U" because of the way the
input stack works, but with some effort you can work around the
metafication problem.  You need to define a new key sequence for each
metafied character (similar to the way insert-composed-char works)
and substitute those into the string before pushing it with "zle -U".

If the only reason you need zle -U is for delayed-action self-insert
(no movement/command widgets involved), then you can define a widget
that manages a stack (array param) of values to be appended onto
LBUFFER, and each time you "zle -U" the key bound to that widget you
also put a new value on the stack array.

There might also be a way to work "bindkey -s" in there so that you
can "execute" the value from the top of the stack instead of just
appending it to LBUFFER, but I'm not going to try to figure that out.


      reply	other threads:[~2016-01-10 20:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10  8:18 Sebastian Gniazdowski
2016-01-10  8:40 ` Sebastian Gniazdowski
2016-01-10  9:21   ` Sebastian Gniazdowski
2016-01-10 11:38     ` Sebastian Gniazdowski
2016-01-10 20:51       ` Bart Schaefer [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=160110125149.ZM1234@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).