From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12568 invoked by alias); 16 Dec 2014 19:17:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33980 Received: (qmail 26363 invoked from network); 16 Dec 2014 19:17:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1418757102; bh=fOvcbx48Ii/6Y5xnfKpBG3LaIVZPRyLpOaGg5+FYRBs=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=i4xWu/wiTF7rPbf62jndnDKR7kYT4k9YpmXgeMunNC73w1UFuun+AsC1DOAfJ0XFhQ7c0M3/yGvekq+tCSOSiPdtPt9KcfJ8slzoBevDBeFa3GfklsWyLuuadU+PwNT6vLN6bL/JDs1vt0+ldXVLK0lW1ezQBubOxpFPSBrs5yT0iV1nfI+1Xf+dXVT7EYBPSmXDlk3w6FLdFpd53+ReXl4Mi5cBuf59x50BBaqfnKHvNMFlnp/XH4SeOxhKD0xT5ayp95SInDnwCCZjai2GwWDn7/8o920sx+MiymBVEIdbjGCai3ayFffx3BatGUrlC+dnjCFF1szZFQMPWUafMA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=mO6Mgl3Y5Tz84RRWKdnH7sA90hV1YBaaPryFBU4tnZNHqOO6Ta+vo6UdNHtF5uY+mEv/BGmFuQ0kZR5ytopA/f7jZWGseZ/ng1xuJyrQjnP6O366bmk10d8VK7lnPrs+g3u2fTyLk0TlrtU8la0NoHr42HG0yfs3EJX08KNzUm9oPL+S3TEiQN76KZJqcEK4FnZdI2bVxYudAo+lG0qc7BOjLZRvpo91RPDbRZw5GvTtP6Jxuj5GyqENJjWZUdCcxd+/ShIRb0KBBaXAXYnORQv27/OUU6WW/hpAydk8dJOcfvS2ds87rH0AXbYsPf6amJEm8kF1Rav/s8UR6YhO2w==; X-Yahoo-Newman-Id: 882248.50530.bm@smtp135.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: mH79KgQVM1m8BOJKRGI6hgXzM_VEB6on0vGgce_esF1KBRs GyCPY3WCDDK.PIP76uEor7lHQhncqWdkNjj5tTxCcbzD5XU6jefGO.eYJbic XvPWiZGLdXtJZv3xBYcuMrUuLgSlcEkyoQBX0gpdRrXAs6RNgcEpVpq4w7ZY aXDhjvhhyQ.T1sGMjvtTlaY2cpnew8.lV96_a.Bkq4O8.MOxKjl6rH5w6cWv wxjoABw8dRvS.IKL0yYJGHsm123EYjYngffbnytWvxsMbospF42wnyHXN8ey jpiuYOZHm8pY3Xm5bwiNa5qvBmy0xqss6d_laraxVl7lSJEJiu58sCduNIgI 1ZPjxCHrOXoyoA3H1JZP3VA8tmxAgNoCDfxLXvR8jK8AfJB0bZBg3Uauj35G lTCPI.cYxoiXQvEMB34yeOedeY5exowwTDUtALPA0B5HmkZb7i0EHyC7xOPf 8lmO0_deOMlLo3yqvOSazn6.zZJoJC6Y6P9Ja8GT3O2I0buv3GHG9gLHRUM7 JsOnPRnFk5JeF9ns20UFYtjySPWaK0Q-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <141216084537.ZM18852@torch.brasslantern.com> From: Oliver Kiddle References: <6B615901-83A3-41A0-9017-3EFA7EF5CA42@kba.biglobe.ne.jp> <141216084537.ZM18852@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: accept-and-hold in interactive mode of menu select MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10371.1418757100.1@thecus.kiddle.eu> Date: Tue, 16 Dec 2014 20:11:40 +0100 Message-ID: <10372.1418757100@thecus.kiddle.eu> Bart wrote: > > I'm not entirely sure that's wrong; accept means to accept what is on the > command line, not to accept what is highlighted in the menu. You have to > finish the action of choosing one of the menu items so that the command > line is updated, before you accept. No, with menu selection many widgets have quite different behaviour. The documented behaviour of accept-and-hold is to insert the currently selected match but keep the menu active so that you can select another match. accept-line-and-down-history does the same but doesn't seem to be documented. It's a useful feature. Coopting existing widgets in this way allows existing key bindings to automatically pick up related behaviour but it does mean that they aren't quite doing what their name would imply. In a separate thread Bart recently wrote: > I hadn't seen auto-fu before but it appears to be a rewrite of the old > incremental-complete-word functions. I'm mildly surprised to see that > it's using the keymap+widget technique, I didn't think anyone had even > noticed that existed. The keymap+widget technique is somewhat related. I was aware of it but haven't applied it because it involves rebinding lots of core widgets. A number of omz plugins rebind stuff en-masse and I suspect that's one reason why people turn up on IRC wondering why things are broken when they enable too many plugins. At its basic level keymap+widget seems to just be a way to define the behaviour of a widget for a particular keymap separately so you can have one function for say ucase and another for say lcase and you can use one without the other. Perhaps a more generic mechanism would be to allow zle widget aliases to be keymap specific. (Or possibly conditional on a selection of things using zstyle as a backend.) We could then make, e.g vi-up-line-or-history an explicit alias for a new menuselect+prev-entry widget in the menuselect keymap. For the too many omz plugins case, we'd need to somehow allow the aliases to be chained so I'm not sure that this is a complete solution. Oliver