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.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version:content-type;
        bh=npdvceXUUbl7ULBt4JV13T+zyxMiS5WMtZmSyssMFec=;
        b=wojrxZbmb8D8WnPl2leFsrdiwfEBFvBHAjcr5a/r9Ew0TzsVqvCjhJulItZFB8TDPN
         45m2IenrAFbPdqg+/Z3c329DPbJKoZEl4GkP5QuHnRnj8R982Anbncl4wTKi/DHnnf2r
         B+t4ikhojner9tntpWXtiOvYn5841UkNl+veiTf12KLUCjCuCinA5zwuNVd8v/ueZlgH
         Gx8VS8uHtFGCCz9acCdnOMp4PSLqIgtsSu+6qGkR2ZNspRkK8sNSRN4b7AjpWwkNGZGP
         StKUuFb+dXI/yKMMRGZWQmX6RMyPXg64fgGnBhlSRePw76+SXmistZ/o19JDvf/TZsBN
         fP+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version:content-type;
        bh=npdvceXUUbl7ULBt4JV13T+zyxMiS5WMtZmSyssMFec=;
        b=j5S/rNespgs4xXFHwKAyGmdF4RIy/u7YylSL9MEKU9S3pHpbTNXH3FSNgyL8c8BLP3
         CPKN1e7irdlLI7qDC/15n0jVFq1oExBKrSZzBaH36oHay5a+G/RkX9gMFtY4gPdWGQ2m
         lO1gbQa6DyWM0jBQ0pQr4Ye5mtCKuRq/AEqDTVwlGohB8/0oR+UNhEPfFJTHYSvRtsBA
         CGWGhki0H9x7DzE61/ED2pt+E7w0X6kNU1JfO26U3OApTSqHz+2qmciuR2tpEuICWywN
         K+HIIL2MXdFu4fHpuAytp1/P40g7zUQOmoxdJuXaYiJffZ5OrgjPNJ8ZY1iyGHpIIFd1
         BYXg==
X-Gm-Message-State: ALoCoQnfXXClR9SK4YVOLO4XghT+r3AgnpTO4o4jPItJoy5x+jQb2UJ/DZj5+UqBwiiUc9IlN8uzIWR2CD5VNRbqblfGH2uEvA==
X-Received: by 10.98.11.151 with SMTP id 23mr21275282pfl.93.1452459097434;
        Sun, 10 Jan 2016 12:51:37 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160110125149.ZM1234@torch.brasslantern.com>
Date: Sun, 10 Jan 2016 12:51:49 -0800
In-Reply-To: <CAKc7PVADMeoR-9CjdhNRePNe_2Ymiz77Go+xUtbirCU9fT01pA@mail.gmail.com>
Comments: In reply to Sebastian Gniazdowski <sgniazdowski@gmail.com>
        "Re: zle -U "$selected" doesn't handle (some?) multibyte characters" (Jan 10, 12:38pm)
References: <CAKc7PVD7N_xaeXSZHB1Q4kmzayjiPA5BNTwkDM5mQF-Zj9SmFg@mail.gmail.com> 
	<CAKc7PVAm0W7RJrK8-rZvuAF+jGZK-KNLjsjyaSy9PgaMYzKx=w@mail.gmail.com> 
	<CAKc7PVAPNZnNj+237eMSQgGtNBqaD8jLtHbBcG1+FTpX=Yv++w@mail.gmail.com> 
	<CAKc7PVADMeoR-9CjdhNRePNe_2Ymiz77Go+xUtbirCU9fT01pA@mail.gmail.com>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zle -U "$selected" doesn't handle (some?) multibyte characters
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37555

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.

