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

Re: Fish-like autosuggestions

On Wed, Nov 6, 2013 at 12:07 PM, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Tue, 05 Nov 2013 12:40:00 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> On Nov 5, 11:46am, Bart Schaefer wrote:
>> }
>> } Hmm, the doc doesn't actually explain what the return value from a -F
>> } handler means to the surrounding code.
> It doesn't mean anything: it doesn't make sense for a function
> listening for one file descriptor to cause aborting of a function or
> widget associated with a different descriptor.

OK, I only asked because the examples seem to have different return
values for success/failure, and I wanted to be sure that wasn't more
than a programming habit.

> You'll have to associate a widget with a file descriptor, so it'll need
> to have a specific name [... and]
> can't just use a generic widget because we don't know what file
> descriptors we're listening on.

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).

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