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

Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?

On Sun, Mar 28, 2021 at 8:47 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sun, Mar 28, 2021 at 9:34 AM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> > Why? What is the reason for this?
> _message is intended to be called as a last resort when the completion
> function believes it is impossible to generate matches.
> (FWIW, I think this behavior pre-dates the ability to complete words
> from history, which obviously means it's never literally impossible to
> generate something.)

Would there be any drawback to removing this check? A completer can
already return 0 to prevent further completers from being called. This
seems like unnecessary special-casing to me. Correct me if I'm wrong.

> > And is there a convenient way to work around this behavior?
> What does "convenient" mean here?  More convenient than just invoking
> a binding for history-complete when you see the message, so that the
> _grep completion is bypassed?

Convenient would be that I could specify through a zstyle that I don't
want that behavior. Though, why anyone would actually want the current
behavior is unclear to me.

> You might be able to do something by specifying a different completion
> for the tag :completion::complete:grep:argument-1:

_grep was just an example. I'm looking for a more general-purpose solution.

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