From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26424 invoked from network); 19 Apr 2004 20:14:28 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Apr 2004 20:14:28 -0000 Received: (qmail 7208 invoked by alias); 19 Apr 2004 20:14:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19797 Received: (qmail 7196 invoked from network); 19 Apr 2004 20:14:18 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 19 Apr 2004 20:14:18 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 19 Apr 2004 20:14:18 -0000 Received: (qmail 2055 invoked from network); 19 Apr 2004 20:14:18 -0000 Received: from wbar3.sjo1-4-11-009-147.sjo1.dsl-verizon.net (HELO candle.brasslantern.com) (4.11.9.147) by a.mx.sunsite.dk with SMTP; 19 Apr 2004 20:14:16 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i3JKEF410563 for zsh-workers@sunsite.dk; Mon, 19 Apr 2004 13:14:15 -0700 From: Bart Schaefer Message-Id: <040419131414.ZM10562@candle.brasslantern.com> Date: Mon, 19 Apr 2004 13:14:14 -0700 In-Reply-To: <7855.1082395211@trentino.logica.co.uk> Comments: In reply to Oliver Kiddle "Re: menuselect and history" (Apr 19, 7:20pm) References: <20040419095235.GA1285@kopfermann.org> <040419092341.ZM10180@candle.brasslantern.com> <7855.1082395211@trentino.logica.co.uk> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: menuselect and history MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.7 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.7 On Apr 19, 7:20pm, Oliver Kiddle wrote: > > Bart wrote: > > emulate -L zsh > > zmodload -i zsh/parameter || return 1 > > I would tend to be inclined to use _generic to avoid needing such setup > code. Does that succeed in forcing menu-selection to always be used? Normal menu completion can't work here because you're completing multiple words simultaneously -- one word (the command) is being replaced by many (the whole command line, possibly many lines), and that confuses the heck out of the completion system because the semantic context isn't the same in all the "matches." Hence this ... > effectively operating outside of compsys, using raw compwid. ... is, in this case, partly intentional. > I wonder if we should make #compdef -k, make widgets go through > _generic somehow. That can be solved by having the function redefine itself like so: --- 8< --- snip --- 8< --- #compdef -k menu-select ^X: zle -C history-select menu-select _generic zstyle ':completion:history-select::::' completer _history_select bindkey '^X:' history-select _history_select() { # ... my original function body here ... } _generic "$@" --- 8< --- snip --- 8< --- Presumably `compdef' could be fixed up to do the equivalent when passed the correct options. I'd recommend leaving -k as it is and adding a new option to automatically apply the _generic wrapper.