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?
- X-seq: zsh-workers 48291
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?
- Date: Sun, 28 Mar 2021 21:06:53 +0300
- Archived-at: <https://zsh.org/workers/48291>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/CAHLkEDvZ%3DhRKVXKjRpZsBCJ9DRm4wNEFpQ0EReHkgm7hGa-iTQ%40mail.gmail.com>
- In-reply-to: <CAH+w=7bksUsvS6ixQ-zkCeYYf9+mrE4qz7CuVKW8CGuv=MAjOw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDt+5xiu62fLb2Gp9gQOh9Q_o8+-He64fooMMxPceon4vA@mail.gmail.com> <CAH+w=7bksUsvS6ixQ-zkCeYYf9+mrE4qz7CuVKW8CGuv=MAjOw@mail.gmail.com>
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