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 48360
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- 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: Wed, 31 Mar 2021 23:20:13 +0000
- Archived-at: <https://zsh.org/workers/48360>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/20210331232013.GC16838%40tarpaulin.shahaf.local2>
- In-reply-to: <CAHLkEDsrQz7t2bn473aBk=G+gRokEfH5GWq=QFDi1ZEm=91Kyg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDt+5xiu62fLb2Gp9gQOh9Q_o8+-He64fooMMxPceon4vA@mail.gmail.com> <74277-1616967738.353098@Tsys.Nn18.rMz7> <CAHLkEDsrQz7t2bn473aBk=G+gRokEfH5GWq=QFDi1ZEm=91Kyg@mail.gmail.com>
Marlon Richert wrote on Wed, Mar 31, 2021 at 09:29:00 +0300:
> On Mon, Mar 29, 2021 at 12:42 AM Oliver Kiddle <opk@xxxxxxx> wrote:
> > Marlon Richert wrote:
> > > And is there a convenient way to work around this behavior? I want
> > > _history to be tried when _complete fails, but this behavior often
> > > prevents it. For example, if I try `grep \t`, then I get only the
> > > message `pattern`, whereas I would like to get history words.
> >
> > You could create a wrapper for _complete that unsets it, something like:
> > _complete_nomesg() {
> > _complete
> > local ret=$?
> > _comp_mesg=
> > return ret
> > }
> >
> > It might be better to experiment with something like that first. You'll
> > find that _message changing compstate[insert] is also affecting it.
>
> I've been using some variation of the code below in my
> [zsh-autocomplete plugin]
> (https://github.com/marlonrichert/zsh-autocomplete) since last July
> (so, for about 9 months now) and I have yet to experience any issues
> from it, nor have any of my end users reported any issues from it.
> That’s why I’m asking whether the behavior upstream is actually
> necessary.
>
> autoload +X -Uz _complete
> functions[_autocomplete._complete]=$functions[_complete]
> _complete() {
> _autocomplete._complete "$@"
> local -i ret=$?
> (( ret )) && _comp_mesg=''
> return ret
Considered using an «{ } always { }» block?
> }
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author