Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Fish-like autosuggestions

On Wed, 06 Nov 2013 16:04:23 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> You've already implemented your idea so perhaps this is moot, but to
> explain my thought: The same widget could get invoked for all
> descriptors as long as it has a way to tell which descriptor caused
> the call.  Hence my suggestion of putting the descriptor number in
> $NUMERIC etc.; the single widget could just do "case $NUMERIC in ..."
> or something (such as passing the FD as an argument, which appears to
> be what you did).

I can see that --- and it's probably entirely moot at this point --- but
I think of it this way: you've set up a file descriptor for a particular
purpose.  Rather than edit an existing widget handling file descriptors
for completely different purposes, which is a maintainance problem, you
probably want to run a completely different chunk of code.  In other
words, what's needed is a bit more like binding a keystroke to a
widget than running a fixed widget in a specific circumstance.  The
semantics of zle -F have that binding effect.

Anyway, I think it's down to seeing if the change does the trick.  By
the way, note that using "zle -F" with an existing file descriptor
silently overwrites the previous handler (another parallel with key
binding), even if the mechanism has changed, which partially contradicts
what I said before.

I'll probalby commit this before 5.0.3 (not 4.0.3) since it shouldn't
break anything existing and I should be able to confirm that as I use
the old interface all the time.


Messages sorted by: Reverse Date, Date, Thread, Author