unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] completion: remove "setup" from the list of possible completions
       [not found] <CGME20200619104051eucas1p1d5d63105518817bc80b55cfc9158ce2f@eucas1p1.samsung.com>
@ 2020-06-19 10:40 ` Łukasz Stelmach
  2020-06-20 10:53   ` Reto
  0 siblings, 1 reply; 12+ messages in thread
From: Łukasz Stelmach @ 2020-06-19 10:40 UTC (permalink / raw)
  To: notmuch; +Cc: Łukasz Stelmach

Having "setup" in the set requires entering three instad of two characters
for "search". Since "setup" is rearly used it makes little sense to have
it in the set and cripple UX for much more frequently used "search".
---
 completion/notmuch-completion.bash | 2 +-
 completion/zsh/_notmuch            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 15425697..c3654a73 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -579,7 +579,7 @@ _notmuch_tag()
 
 _notmuch()
 {
-    local _notmuch_commands="compact config count dump help insert new reply restore reindex search address setup show tag emacs-mua"
+    local _notmuch_commands="compact config count dump help insert new reply restore reindex search address show tag emacs-mua"
     local arg cur prev words cword split
 
     # require bash-completion with _init_completion
diff --git a/completion/zsh/_notmuch b/completion/zsh/_notmuch
index e920f10b..6c0344cc 100644
--- a/completion/zsh/_notmuch
+++ b/completion/zsh/_notmuch
@@ -7,7 +7,6 @@ _notmuch_command() {
   local -a notmuch_commands
   notmuch_commands=(
     'help:display documentation for a subcommand'
-    'setup:interactively configure notmuch'
 
     'address:output addresses from matching messages'
     'compact:compact the notmuch database'
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-19 10:40 ` [PATCH] completion: remove "setup" from the list of possible completions Łukasz Stelmach
@ 2020-06-20 10:53   ` Reto
  2020-06-20 14:04     ` Tomi Ollila
       [not found]     ` <CGME20200622102303eucas1p2121610b68b1d23705237632706cb06ab@eucas1p2.samsung.com>
  0 siblings, 2 replies; 12+ messages in thread
From: Reto @ 2020-06-20 10:53 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: notmuch

On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
> Having "setup" in the set requires entering three instad of two characters
> for "search". Since "setup" is rearly used it makes little sense to have
> it in the set and cripple UX for much more frequently used "search".

I very much disagree with this patch.
The completions should contain all possible values, saving a single keystroke is
certainly not a valid reason to remove a valid option from the completions.

Write an alias into your bashrc if that bothers you so much... Then you can save
much more keystrokes.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-20 10:53   ` Reto
@ 2020-06-20 14:04     ` Tomi Ollila
  2020-06-20 19:09       ` Ralph Seichter
       [not found]     ` <CGME20200622102303eucas1p2121610b68b1d23705237632706cb06ab@eucas1p2.samsung.com>
  1 sibling, 1 reply; 12+ messages in thread
From: Tomi Ollila @ 2020-06-20 14:04 UTC (permalink / raw)
  To: Reto, Łukasz Stelmach; +Cc: notmuch

On Sat, Jun 20 2020, reto@labrat.space wrote:

> On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
>> Having "setup" in the set requires entering three instad of two characters
>> for "search". Since "setup" is rearly used it makes little sense to have
>> it in the set and cripple UX for much more frequently used "search".
>
> I very much disagree with this patch.
> The completions should contain all possible values, saving a single keystroke is
> certainly not a valid reason to remove a valid option from the completions.

I disagree your disagreement, and would.be very much favorable to this
change.

imo.the completions should primarily provide convenience to the interactive
user, to see all possible options (also those seldomly.used) one can use
help and namual pages...

Tomi

>
> Writeuuuuuu an alias into your bashrc if that bothers you so much... Then you can save
> much more keystrokes.
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-20 14:04     ` Tomi Ollila
@ 2020-06-20 19:09       ` Ralph Seichter
  2020-06-23 21:04         ` Tomi Ollila
  0 siblings, 1 reply; 12+ messages in thread
From: Ralph Seichter @ 2020-06-20 19:09 UTC (permalink / raw)
  To: notmuch

* Tomi Ollila:

> imo.the completions should primarily provide convenience to the
> interactive user, to see all possible options (also those
> seldomly.used) one can use help and namual pages...

"Can use" being the operative term, not "should have to use". I would
not want completion to omit certain commands, based on somebody else's
notion of what is convenient, which in turn forces me to use other means
of figuring out a seldom-used command I may or may not be aware of.

If this means entering three characters instead of two, then three
characters it is. Alternatively, make it a configurable option, with
"convenient=false" being the default. I vote against the change.

First world problems... ;-)

-Ralph

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
       [not found]     ` <CGME20200622102303eucas1p2121610b68b1d23705237632706cb06ab@eucas1p2.samsung.com>
@ 2020-06-22 10:22       ` Lukasz Stelmach
  2020-06-24 11:44         ` Peter Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Lukasz Stelmach @ 2020-06-22 10:22 UTC (permalink / raw)
  To: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 1020 bytes --]

It was <2020-06-20 sob 12:53>, when Reto wrote:
> On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
>> Having "setup" in the set requires entering three instad of two characters
>> for "search". Since "setup" is rearly used it makes little sense to have
>> it in the set and cripple UX for much more frequently used "search".
>
> I very much disagree with this patch.
> The completions should contain all possible values, saving a single keystroke is
> certainly not a valid reason to remove a valid option from the completions.
>
> Write an alias into your bashrc if that bothers you so much... Then you can save
> much more keystrokes.

I already have several aliases covering most of my use cases, however, I
still use "notmuch search" from time to time and I came to a conclusion
expressed in this patch. Of course, as a random user, I can only suggest
and by no means insist on applying it.

Kind regards,
-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-20 19:09       ` Ralph Seichter
@ 2020-06-23 21:04         ` Tomi Ollila
  2020-06-23 22:46           ` Ralph Seichter
  0 siblings, 1 reply; 12+ messages in thread
From: Tomi Ollila @ 2020-06-23 21:04 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

On Sat, Jun 20 2020, Ralph Seichter wrote:

> * Tomi Ollila:
>
>> imo.the completions should primarily provide convenience to the
>> interactive user, to see all possible options (also those
>> seldomly.used) one can use help and namual pages...
>
> "Can use" being the operative term, not "should have to use". I would
> not want completion to omit certain commands, based on somebody else's
> notion of what is convenient, which in turn forces me to use other means
> of figuring out a seldom-used command I may or may not be aware of.
>
> If this means entering three characters instead of two, then three
> characters it is. Alternatively, make it a configurable option, with
> "convenient=false" being the default. I vote against the change.
>
> First world problems... ;-)

Indeed! You're wrong and I am right... ;) unfortunately the margin is too
small and status quo (i.e. what we have now) may prevail.

(well, I haven't even installed the completions -- perhaps I write my own
 zsh completions which will expand 'notmuch s' -> 'notmuch search' ;D) --
 note that I also have no notmuch-* commands in my PATH, so 'notm' expands
 to 'notmuch ' ! \o/ FTW ;)

>
> -Ralph

Tomi (one random user like all of us)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-23 21:04         ` Tomi Ollila
@ 2020-06-23 22:46           ` Ralph Seichter
  0 siblings, 0 replies; 12+ messages in thread
From: Ralph Seichter @ 2020-06-23 22:46 UTC (permalink / raw)
  To: notmuch

* Tomi Ollila:

> You're wrong and I am right... ;)

"I'm sorry, if you were right, I would agree with you." (Dr. M. Sayer) :-)

> note that I also have no notmuch-* commands in my PATH, so 'notm'
> expands to 'notmuch ' ! \o/ FTW ;)

I like aliases like "nme" for "Notmuch in Emacs".

-Ralph

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-22 10:22       ` Lukasz Stelmach
@ 2020-06-24 11:44         ` Peter Wang
  2020-07-02 19:55           ` Daniel Kahn Gillmor
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Wang @ 2020-06-24 11:44 UTC (permalink / raw)
  To: Lukasz Stelmach; +Cc: notmuch

On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach <l.stelmach@samsung.com> wrote:
> It was <2020-06-20 sob 12:53>, when Reto wrote:
> > On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
> >> Having "setup" in the set requires entering three instad of two characters
> >> for "search". Since "setup" is rearly used it makes little sense to have
> >> it in the set and cripple UX for much more frequently used "search".
> >
> > I very much disagree with this patch.
> > The completions should contain all possible values, saving a single keystroke is
> > certainly not a valid reason to remove a valid option from the completions.
> >
> > Write an alias into your bashrc if that bothers you so much... Then you can save
> > much more keystrokes.
> 
> I already have several aliases covering most of my use cases, however, I
> still use "notmuch search" from time to time and I came to a conclusion
> expressed in this patch. Of course, as a random user, I can only suggest
> and by no means insist on applying it.

Another possibility may be to rename "notmuch setup" to "notmuch init",
treating "setup" as a deprecated synonym for "init". The completions
would include "init" but not "setup".

(Just an idea, I don't really care.)

Peter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-06-24 11:44         ` Peter Wang
@ 2020-07-02 19:55           ` Daniel Kahn Gillmor
       [not found]             ` <CGME20200708151938eucas1p26c111da083d7e8248f6d59593ed40fa7@eucas1p2.samsung.com>
                               ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Daniel Kahn Gillmor @ 2020-07-02 19:55 UTC (permalink / raw)
  To: Peter Wang, Lukasz Stelmach; +Cc: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 2872 bytes --]

On Wed 2020-06-24 21:44:01 +1000, Peter Wang wrote:
> On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach <l.stelmach@samsung.com> wrote:
>> It was <2020-06-20 sob 12:53>, when Reto wrote:
>> > On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
>> >> Having "setup" in the set requires entering three instad of two characters
>> >> for "search". Since "setup" is rearly used it makes little sense to have
>> >> it in the set and cripple UX for much more frequently used "search".
>> >
>> > I very much disagree with this patch.
>> > The completions should contain all possible values, saving a single keystroke is
>> > certainly not a valid reason to remove a valid option from the completions.
>> >
>> > Write an alias into your bashrc if that bothers you so much... Then you can save
>> > much more keystrokes.
>> 
>> I already have several aliases covering most of my use cases, however, I
>> still use "notmuch search" from time to time and I came to a conclusion
>> expressed in this patch. Of course, as a random user, I can only suggest
>> and by no means insist on applying it.
>
> Another possibility may be to rename "notmuch setup" to "notmuch init",
> treating "setup" as a deprecated synonym for "init". The completions
> would include "init" but not "setup".

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.

I value having all non-deprecated subcommands show up in tab completion.
This is particularly important for someone who is just starting to use
notmuch, and may use tab completion for discoverability.  If they can't
find the very first expected subcommand to be used in tab completion
exploration, that is pretty weird.

That said, i appreciate Peter's clever attempt to thread the needle.

Unfortunately, changing "setup" to "init" moves "notmuch insert" from
"notmuch i<TAB>" to "notmuch in<TAB>", so you're sort of robbing from
Peter to pay Paul.  And I'm having difficulty coming up with another
good subcommand name with an unambiguous prefix to move "setup" to.

I also note that we have no independent manpage for "notmuch-setup",
it's just symlinked from notmuch.1.gz.

Another "clever" approach to assuage the tab-completion-for-conveience
advocates would be to introduce a (non-deprecated) alias for "search"
that itself would be fewer keystrokes before tab completion (e.g. "srch"
is two keystrokes because "sr" is unambiguous, "query" is just one,
because "q" is unambiguous).

Overall, i value consistency and completeness and i would not like to
see the tab completion be either an inconsistent or incomplete
representation of the options available to the user from the command
line.

    --dkg

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
       [not found]             ` <CGME20200708151938eucas1p26c111da083d7e8248f6d59593ed40fa7@eucas1p2.samsung.com>
@ 2020-07-08 15:19               ` Lukasz Stelmach
  0 siblings, 0 replies; 12+ messages in thread
From: Lukasz Stelmach @ 2020-07-08 15:19 UTC (permalink / raw)
  To: Daniel Kahn Gillmor; +Cc: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 2027 bytes --]

It was <2020-07-02 czw 15:55>, when Daniel Kahn Gillmor wrote:
> On Wed 2020-06-24 21:44:01 +1000, Peter Wang wrote:
>> On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach <l.stelmach@samsung.com> wrote:
>>> It was <2020-06-20 sob 12:53>, when Reto wrote:
>>>> On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach wrote:
>>>>> Having "setup" in the set requires entering three instad of two
>>>>> characters for "search". Since "setup" is rearly used it makes
>>>>> little sense to have it in the set and cripple UX for much more
>>>>> frequently used "search".
>>>>
>>>> I very much disagree with this patch.  The completions should
>>>> contain all possible values, saving a single keystroke is certainly
>>>> not a valid reason to remove a valid option from the completions.
>>>>
>>>> Write an alias into your bashrc if that bothers you so
>>>> much... Then you can save much more keystrokes.
>>> 
>>> I already have several aliases covering most of my use cases,
>>> however, I still use "notmuch search" from time to time and I came
>>> to a conclusion expressed in this patch. Of course, as a random
>>> user, I can only suggest and by no means insist on applying it.
>>
>> Another possibility may be to rename "notmuch setup" to "notmuch
>> init", treating "setup" as a deprecated synonym for "init". The
>> completions would include "init" but not "setup".
>
> 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.
>
[...]
>
> Overall, i value consistency and completeness and i would not like to
> see the tab completion be either an inconsistent or incomplete
> representation of the options available to the user from the command
> line.

How about checking for $NOTMUCH_CONFIG and adding "setup" if the file
does not exist?

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-07-02 19:55           ` Daniel Kahn Gillmor
       [not found]             ` <CGME20200708151938eucas1p26c111da083d7e8248f6d59593ed40fa7@eucas1p2.samsung.com>
@ 2021-06-05 11:42             ` David Bremner
  2021-06-05 13:59             ` Felipe Contreras
  2 siblings, 0 replies; 12+ messages in thread
From: David Bremner @ 2021-06-05 11:42 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, Peter Wang, Lukasz Stelmach; +Cc: notmuch

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

>
> Unfortunately, changing "setup" to "init" moves "notmuch insert" from
> "notmuch i<TAB>" to "notmuch in<TAB>", so you're sort of robbing from
> Peter to pay Paul.  And I'm having difficulty coming up with another
> good subcommand name with an unambiguous prefix to move "setup" to.
>

Do people run "notmuch insert" interactively other than for testing? I
thought it was mostly invoked from .forward or equivalent.

d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] completion: remove "setup" from the list of possible completions
  2020-07-02 19:55           ` Daniel Kahn Gillmor
       [not found]             ` <CGME20200708151938eucas1p26c111da083d7e8248f6d59593ed40fa7@eucas1p2.samsung.com>
  2021-06-05 11:42             ` David Bremner
@ 2021-06-05 13:59             ` Felipe Contreras
  2 siblings, 0 replies; 12+ messages in thread
From: Felipe Contreras @ 2021-06-05 13:59 UTC (permalink / raw)
  To: Daniel Kahn Gillmor; +Cc: Lukasz Stelmach, notmuch@notmuchmail.org

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-07-30 11:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20200619104051eucas1p1d5d63105518817bc80b55cfc9158ce2f@eucas1p1.samsung.com>
2020-06-19 10:40 ` [PATCH] completion: remove "setup" from the list of possible completions Łukasz Stelmach
2020-06-20 10:53   ` Reto
2020-06-20 14:04     ` Tomi Ollila
2020-06-20 19:09       ` Ralph Seichter
2020-06-23 21:04         ` Tomi Ollila
2020-06-23 22:46           ` Ralph Seichter
     [not found]     ` <CGME20200622102303eucas1p2121610b68b1d23705237632706cb06ab@eucas1p2.samsung.com>
2020-06-22 10:22       ` Lukasz Stelmach
2020-06-24 11:44         ` Peter Wang
2020-07-02 19:55           ` Daniel Kahn Gillmor
     [not found]             ` <CGME20200708151938eucas1p26c111da083d7e8248f6d59593ed40fa7@eucas1p2.samsung.com>
2020-07-08 15:19               ` Lukasz Stelmach
2021-06-05 11:42             ` David Bremner
2021-06-05 13:59             ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).