From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8542 invoked by alias); 25 Feb 2013 21:49:41 -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: 31067 Received: (qmail 25624 invoked from network); 25 Feb 2013 21:49:38 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.128.50 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=TMlLPKHUo0uPHcZaj9GUbBzaQwA0oPoWnPnef9c3adU=; b=CmCcBzI4rogy973m/QYyvIdq0Hcu2CpO5obTNF1GITg7BoAuyPov5p9ETnvzC4f5CS xYHz1dzy5rbJK9l/dZfupyQJmuJumjU9j1341m1oLBQe22347ARo0mLODSGijiyDW2Jr 3dAOLfDlM7CHvOZDFJooXMqF356AMsRo5s69JTRY7LAqNl/qhFTvlT7Y4dYE75ThJXu6 uJlJ58fsOD/Vm0c8QALoxMi8eqv0HpWE/9IWnByj9FfotXaeBcCoYIKjcwSsFhdO5AVK NLHvMT8OFs96TgiJT0jwbPDC9wRaVjUTsUjTPQVP3ixFEe8kpqzKXFyzMB4clYkkgN9y YTPQ== X-Received: by 10.224.186.82 with SMTP id cr18mr13935477qab.64.1361828971749; Mon, 25 Feb 2013 13:49:31 -0800 (PST) MIME-Version: 1.0 From: Olivier Teuliere Date: Mon, 25 Feb 2013 22:49:11 +0100 Message-ID: Subject: Limitations of menuselect To: zsh-workers@zsh.org Content-Type: text/plain; charset=ISO-8859-1 Hi, I recently discovered the menu selection feature and I would like to use it. Unfortunately, it doesn't work as well as I expected (using zsh 5.0.0), so here are some bug reports and suggestions. 1) Custom bindings don't work. You can try it with the following: my-widget() { zle down-line-or-history }; zle -N my-widget; bindkey -M menuselect k my-widget (replacing "my-widget" with "down-line-or-history" in the bindkey command works as expected). Someone told me on IRC that in menuselect a hard-coded table is used to lookup the widget names. So, could you add support for custom widgets in menuselect? This would allow many cool things, in particular, I think it would let me work-around items 2, 3 and 4 below. 2) Moving the selected menu item line by line is nice, but scrolling several lines at a time would be nicer (that's what I would expect PageUp and PageDown to do by default in menuselect, for example). I couldn't find an existing widget for that. 3) When using the reverse-menu-complete widget to open menuselect, I would like to select the last result, not the first one (otherwise I can use menu-complete directly...). It doesn't sem to be possible at the moment. 4) When moving the selection in the menu, the inserted text changes. But for some reason, the accept-line widget only closes the menu, without accepting the line. So to really accept the line I have to call accept-line again (basically, I have to hit Enter twice). This behavior seems a bit backwards: if I wanted to accept the current selection, which is already inserted, I could simply go on typing, I don't need an extra validation step. So, would it be possible to have accept-line really accept the line? :) If the current behavior is still wanted, it could maybe be called "accept-selection", because the current name is misleading... 5) Apparently, menuselect always inserts the selected text. But if there was a way (maybe using a style) to select a menu entry without inserting the corresponding text, it could allow a killer feature: typing characters could shrink the list of results (for example, by binding individual letter keys to an appropriate widget... accept-line-and-infer-history maybe?), while still allowing to select an item using the arrow keys. Users would get the best of the 2 worlds: if the completion list is too long, typing letters would shrink it until it's small enough to use arrow keys. Currently, it's really annoying to open the menu, realize that there are way too many entries to complete using movement keys, and then undo, type a few more letters, hoping that this time the menu will not be too long... :) Of course, I could use a list instead of a menu, to avoid undoing the completion if there are too many results. But this wouldn't really solve the problem: if I use the list-choices widget In case my description is not clear, you can have a look at the AutoComplPop plugin for Vim [1], which does exactly that by default (except that in addition it opens the menu automatically). It's really a huge time saver. Would that be possible to implement this feature (optional non-insertion of selected text)? I hope that these remarks make sense and that I haven't overlooked some existing features... Please Cc: me in the replies, as I didn't subscribe to the list. Cheers, -- Olivier [1] http://www.vim.org/scripts/script.php?script_id=1879