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

2021-07-30 Thread Lukasz Stelmach
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  
>> 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 Institute Poland
Samsung Electronics


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2021-06-05 Thread Felipe Contreras
On Thu, Jul 2, 2020 at 3:43 PM Daniel Kahn Gillmor
 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 " shows "fetch", but not
"for-each-ref". If you type "git fo" 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-le...@notmuchmail.org


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

2021-06-05 Thread David Bremner
Daniel Kahn Gillmor  writes:

>
> Unfortunately, changing "setup" to "init" moves "notmuch insert" from
> "notmuch i" to "notmuch in", 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
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2020-07-02 Thread Daniel Kahn Gillmor
On Wed 2020-06-24 21:44:01 +1000, Peter Wang wrote:
> On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach  
> 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" to "notmuch in", 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


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2020-06-24 Thread Peter Wang
On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach  
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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-23 Thread Ralph Seichter
* 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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-23 Thread Tomi Ollila
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)
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-22 Thread Lukasz Stelmach
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 Institute Poland
Samsung Electronics


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-20 Thread Ralph Seichter
* 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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-20 Thread Tomi Ollila
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

>
> Writeuu 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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-20 Thread Reto
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.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


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

2020-06-19 Thread Ł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

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch