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

Re: Are completions in some way heavy?

On Jun 8,  6:34am, Sebastian Gniazdowski wrote:
} Subject: Re: Are completions in some way heavy?
} On 7 June 2016 at 22:44, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > Again if they are actually disturbing you, why are you invoking them
} > in the first place?
} Luckily an example can be provided. I was greeping for a text. It was
} returning git objects. Wanted to disable lookup in binary files. But
} can never remember is it "with-binary-files" or something similar
} (turns out it's --binary-files, but my memory didn't play nice on
} this). So I entered grep --with<TAB>. Nothing was returned.

I see.  I don't really have any good suggestions here -- there is the
_complete_fallback idea but all it does is provide alternate guesses
for the possible argument positions, which doesn't help in this case.

It might be do-able to revert to executing run-help when there are no
completions found, but that would be wrong in a lot of cases (e.g.,
on file name not matched, displaying a manual page isn't useful).

} I might have tried grep --binary and nothing would be returned because
} turns out grep completion is very short on long options on OS X (no
} one complained?).

No complaints, no.  It appears from cursory examination that the person
who initally wrote _grep only had access to GNU grep, and _grep has had
only a few minor updates since 2002.

On Jun 8, 11:03am, Oliver Kiddle wrote:
} Subject: Re: Are completions in some way heavy?
} Sebastian Gniazdowski wrote:
} > So why did I try completion. To take a guess maybe. This leads to an
} > idea of how this could be done:
} >
} > - tab invokes "small man page" as it usually does after "command -<TAB>"
} > - the text can be searched - entering something greps lines in the "man page"
} > - bits of text can be navigated like in file completion when properly
} > configured - I mean cursor keys move the reverse highlight over what's
} > available
} Menu selection (the zsh/complist module) has an incremental search, so
} what you describe above can already be done.

I think Sebastian wants to search through the descriptions, whereas the
complist search only examines the completions themselves.

None of this helps with the situation Sebastian described above wherein
the completion results/descriptions do not include the desired content.

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