From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18777 invoked from network); 20 Mar 2006 10:39:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Mar 2006 10:39:40 -0000 Received: (qmail 89710 invoked from network); 20 Mar 2006 10:39:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Mar 2006 10:39:30 -0000 Received: (qmail 21672 invoked by alias); 20 Mar 2006 10:39:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22370 Received: (qmail 21663 invoked from network); 20 Mar 2006 10:39:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Mar 2006 10:39:27 -0000 Received: (qmail 89380 invoked from network); 20 Mar 2006 10:39:27 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 20 Mar 2006 10:39:26 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly22d.srv.mailcontrol.com (MailControl) with ESMTP id k2KAVEDs020471 for ; Mon, 20 Mar 2006 10:39:21 GMT Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 20 Mar 2006 10:37:26 +0000 To: zsh-workers@sunsite.dk Subject: Re: Starting replace-string minibuffer in Vi command-mode In-reply-to: <060319202425.ZM5142@torch.brasslantern.com> References: <200603192243.k2JMhcqd027578@pwslaptop.csr.com> <060319202425.ZM5142@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Sun, 19 Mar 2006 20:24:25 -0800." Date: Mon, 20 Mar 2006 10:37:30 +0000 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 20 Mar 2006 10:37:26.0522 (UTC) FILETIME=[47D5DDA0:01C64C0A] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.68.0.132 Bart Schaefer wrote: > } I tried this and it's very annoying... It seems to me > } read-from-minibuffer looks to the user like a new command line and > } therefore should always start in the "main" keymap, right? > > I'd think so, yes. I'm not sure that's exactly the right thing in this > specific case, but it's closer. As I said, there's room for an extension to select your own main and alternate keymaps similar to vared, but this is the first step. > } There's no way to do this at the moment > > Really? What's wrong with the following? > > vi-read-from-minibuffer() { > zle -K viins > zle read-from-minibuffer > } > zle -N vi-read-from-minibuffer I meant "without rewriting the function", but yes, if you want to alter replace-string that would be fine. > } However, this patch is more consistent with the existing "zle -K" > > Why add a -K option after the widget name rather than allow the widget > name to follow the existing -K option and its argument? That is, why do > > zle read-from-minibuffer -K viins > > rather than > > zle -K viins read-from-minibuffer > > ?? Just curious. It looks like it would be just as easy to call on > through to bin_zle_call() from bin_zle_keymap() as to embed a call to > selectkeymap() in the former. Only because of existing practice... options restricted to the widget (like -n and -N) have tended to come after it. The latter is another possibility. I think I marginally prefer the former anyway, unless you have a strong preference, since the latter looks to me like an additional argument to the keymap-setting function, rather than a widget called in a particular context. Also it's not *so* much easier to do it via bin_zle_keymap(), since you need to restore the keymap afterwards, and you probably want the return status of the widget rather than what zle -K would normally return... but this is all fairly minor. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php