Re: [PATCH] completion: remove "setup" from the list of possible completions

Subject: Re: [PATCH] completion: remove "setup" from the list of possible completions

Date: Sat, 5 Jun 2021 08:59:31 -0500

To: Daniel Kahn Gillmor

Cc: Lukasz Stelmach, notmuch@notmuchmail.org

From: Felipe Contreras


On Thu, Jul 2, 2020 at 3:43 PM Daniel Kahn Gillmor
<dkg@fifthhorseman.net> wrote:

> I sympathize with everyone struggling with the first-world problems in
> this thread. :P
>
> If i had to choose between the status quo and Lukasz's suggestion of not
> completing "notmuch setup", i'd choose the status quo.

Both are right. And while you might have to choose, the project does
not. What do you do when a single behavior doesn't accommodate most
users? You add a configuration.

In git there's a configuration: "completion.commands=-setup", that
takes care of the Bash completions.

And for zsh completions there's a more elegant solution. Commands can
be grouped in tags. By default only the "common-commands" tag is
shown, so for example "git <tab>" shows "fetch", but not
"for-each-ref". If you type "git fo<tab>" however, "for-each-ref" is
completed. The user can change this and show all commands with:

  zstyle ':completion:*:*:git:*' tag-order 'all-commands'

So really, we can have the best of both worlds. All you have to do is
decide what kind of configuration you want.

Cheers.

-- 
Felipe Contreras
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: