Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Starting replace-string minibuffer in Vi command-mode
- X-seq: zsh-workers 22370
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Starting replace-string minibuffer in Vi command-mode
- Date: Mon, 20 Mar 2006 10:37:30 +0000
- In-reply-to: <060319202425.ZM5142@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200603192243.k2JMhcqd027578@xxxxxxxxxxxxxxxxx> <060319202425.ZM5142@xxxxxxxxxxxxxxxxxxxxxx>
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 <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author