unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options
@ 2014-11-10 19:35 Jani Nikula
  2014-11-10 19:35 ` [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Jani Nikula
  2015-01-02 16:22 ` [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options David Bremner
  0 siblings, 2 replies; 11+ messages in thread
From: Jani Nikula @ 2014-11-10 19:35 UTC (permalink / raw)
  To: notmuch

---
 completion/notmuch-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index db152f358bc3..386437333742 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -196,7 +196,7 @@ _notmuch_insert()
     ! $split &&
     case "${cur}" in
 	--*)
-	    local options="--create-folder --folder="
+	    local options="--create-folder --folder= --keep --no-hooks"
 	    compopt -o nospace
 	    COMPREPLY=( $(compgen -W "$options" -- ${cur}) )
 	    return
-- 
2.1.1

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

* [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only
  2014-11-10 19:35 [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options Jani Nikula
@ 2014-11-10 19:35 ` Jani Nikula
  2014-12-31 20:36   ` David Bremner
  2015-01-01 14:34   ` [PATCH v2] " Jani Nikula
  2015-01-02 16:22 ` [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options David Bremner
  1 sibling, 2 replies; 11+ messages in thread
From: Jani Nikula @ 2014-11-10 19:35 UTC (permalink / raw)
  To: notmuch

The --folder option expects a folder relative from maildir root, so
complete like the folder: search term.
---
 completion/notmuch-completion.bash | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 386437333742..a756b22339cb 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -188,7 +188,10 @@ _notmuch_insert()
     $split &&
     case "${prev}" in
 	--folder)
-	    _filedir
+	    local path=`notmuch config get database.path`
+	    compopt -o nospace
+	    COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \
+		sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) )
 	    return
 	    ;;
     esac
-- 
2.1.1

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

* Re: [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only
  2014-11-10 19:35 ` [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Jani Nikula
@ 2014-12-31 20:36   ` David Bremner
  2015-01-01 12:12     ` Tomi Ollila
  2015-01-01 14:34   ` [PATCH v2] " Jani Nikula
  1 sibling, 1 reply; 11+ messages in thread
From: David Bremner @ 2014-12-31 20:36 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:
> +	    local path=`notmuch config get database.path`
> +	    compopt -o nospace
> +	    COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \
> +		sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$"

I'm a bit confused here. Why is 'folder:' being stripped? Too much
copy-pasta?

d

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

* Re: [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only
  2014-12-31 20:36   ` David Bremner
@ 2015-01-01 12:12     ` Tomi Ollila
  2015-01-01 14:33       ` Jani Nikula
  0 siblings, 1 reply; 11+ messages in thread
From: Tomi Ollila @ 2015-01-01 12:12 UTC (permalink / raw)
  To: David Bremner, Jani Nikula, notmuch

On Wed, Dec 31 2014, David Bremner <david@tethera.net> wrote:

> Jani Nikula <jani@nikula.org> writes:
>> +	    local path=`notmuch config get database.path`
>> +	    compopt -o nospace
>> +	    COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \
>> +		sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$"
>
> I'm a bit confused here. Why is 'folder:' being stripped? Too much
> copy-pasta?

compgen -d wants a directory ?

there seems to be similar strippings done in completion of
notmuch_search_terms.

>
> d

Tomi

PS: if it weren't inconsistent change, just on '#' would suffice ;)

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

* Re: [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only
  2015-01-01 12:12     ` Tomi Ollila
@ 2015-01-01 14:33       ` Jani Nikula
  0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2015-01-01 14:33 UTC (permalink / raw)
  To: Tomi Ollila, David Bremner, notmuch

On Thu, 01 Jan 2015, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Wed, Dec 31 2014, David Bremner <david@tethera.net> wrote:
>
>> Jani Nikula <jani@nikula.org> writes:
>>> +	    local path=`notmuch config get database.path`
>>> +	    compopt -o nospace
>>> +	    COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \
>>> +		sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$"
>>
>> I'm a bit confused here. Why is 'folder:' being stripped? Too much
>> copy-pasta?
>
> compgen -d wants a directory ?
>
> there seems to be similar strippings done in completion of
> notmuch_search_terms.


True, but $cur won't have folder: here. Copy-paste fail.

Jani.


>
>>
>> d
>
> Tomi
>
> PS: if it weren't inconsistent change, just on '#' would suffice ;)

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

* [PATCH v2] completion: complete notmuch insert --folder to maildir folders only
  2014-11-10 19:35 ` [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Jani Nikula
  2014-12-31 20:36   ` David Bremner
@ 2015-01-01 14:34   ` Jani Nikula
  1 sibling, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2015-01-01 14:34 UTC (permalink / raw)
  To: notmuch

The --folder option expects a folder relative from maildir root, so
complete like the folder: search term.
---
 completion/notmuch-completion.bash | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 386437333742..d58dc8bed60f 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -188,7 +188,10 @@ _notmuch_insert()
     $split &&
     case "${prev}" in
 	--folder)
-	    _filedir
+	    local path=`notmuch config get database.path`
+	    compopt -o nospace
+	    COMPREPLY=( $(compgen -d "$path/${cur}" | \
+		sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) )
 	    return
 	    ;;
     esac
-- 
2.1.4

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

* Re: [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options
  2014-11-10 19:35 [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options Jani Nikula
  2014-11-10 19:35 ` [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Jani Nikula
@ 2015-01-02 16:22 ` David Bremner
  2015-01-02 17:58   ` Jani Nikula
  1 sibling, 1 reply; 11+ messages in thread
From: David Bremner @ 2015-01-02 16:22 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> ---
>  completion/notmuch-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied this, and v2 of the next patch.

I guess this means the zsh completion is falling behind?

d

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

* Re: [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options
  2015-01-02 16:22 ` [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options David Bremner
@ 2015-01-02 17:58   ` Jani Nikula
  2015-01-02 18:03     ` [PATCH] completion: remove the broken notmuch-completion.tcsh Jani Nikula
  0 siblings, 1 reply; 11+ messages in thread
From: Jani Nikula @ 2015-01-02 17:58 UTC (permalink / raw)
  To: David Bremner, notmuch

On Fri, 02 Jan 2015, David Bremner <david@tethera.net> wrote:
> Jani Nikula <jani@nikula.org> writes:
>
>> ---
>>  completion/notmuch-completion.bash | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Applied this, and v2 of the next patch.
>
> I guess this means the zsh completion is falling behind?

Since a long time ago already, apart from a few updates from Michal
Sojka to match his cli changes. Can't really help with this.

The (minimal) tcsh completion does not work at all, and would be better
off removed.

BR,
Jani.

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

* [PATCH] completion: remove the broken notmuch-completion.tcsh
  2015-01-02 17:58   ` Jani Nikula
@ 2015-01-02 18:03     ` Jani Nikula
  2015-01-02 19:57       ` Tomi Ollila
  2015-01-03  8:46       ` David Bremner
  0 siblings, 2 replies; 11+ messages in thread
From: Jani Nikula @ 2015-01-02 18:03 UTC (permalink / raw)
  To: David Bremner, notmuch

The tcsh completion is minimal yet doesn't work at all. We're better
off without it, it's more embarrassing than useful.
---
 completion/README                  | 4 ----
 completion/notmuch-completion.tcsh | 2 --
 2 files changed, 6 deletions(-)
 delete mode 100644 completion/notmuch-completion.tcsh

diff --git a/completion/README b/completion/README
index 93f0f8bf942c..e200c189058c 100644
--- a/completion/README
+++ b/completion/README
@@ -11,10 +11,6 @@ notmuch-completion.bash
 
   [1] http://bash-completion.alioth.debian.org/
 
-notmuch-completion.tcsh
-
-  Command-line completion for the tcsh shell.
-
 notmuch-completion.zsh
 
   Command-line completion for the zsh shell.
diff --git a/completion/notmuch-completion.tcsh b/completion/notmuch-completion.tcsh
deleted file mode 100644
index c0d3a4463555..000000000000
--- a/completion/notmuch-completion.tcsh
+++ /dev/null
@@ -1,2 +0,0 @@
-set NOTMUCH_CMD=`notmuch help | awk '/\t/' | cut -f2 |grep -v '^$'`
-complete notmuch 'p/1/$NOTMUCH_CMD/'
-- 
2.1.4

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

* Re: [PATCH] completion: remove the broken notmuch-completion.tcsh
  2015-01-02 18:03     ` [PATCH] completion: remove the broken notmuch-completion.tcsh Jani Nikula
@ 2015-01-02 19:57       ` Tomi Ollila
  2015-01-03  8:46       ` David Bremner
  1 sibling, 0 replies; 11+ messages in thread
From: Tomi Ollila @ 2015-01-02 19:57 UTC (permalink / raw)
  To: Jani Nikula, David Bremner, notmuch

On Fri, Jan 02 2015, Jani Nikula <jani@nikula.org> wrote:

> The tcsh completion is minimal yet doesn't work at all. We're better
> off without it, it's more embarrassing than useful.
> ---

Agreed.

Tomi


>  completion/README                  | 4 ----
>  completion/notmuch-completion.tcsh | 2 --
>  2 files changed, 6 deletions(-)
>  delete mode 100644 completion/notmuch-completion.tcsh
>
> diff --git a/completion/README b/completion/README
> index 93f0f8bf942c..e200c189058c 100644
> --- a/completion/README
> +++ b/completion/README
> @@ -11,10 +11,6 @@ notmuch-completion.bash
>  
>    [1] http://bash-completion.alioth.debian.org/
>  
> -notmuch-completion.tcsh
> -
> -  Command-line completion for the tcsh shell.
> -
>  notmuch-completion.zsh
>  
>    Command-line completion for the zsh shell.
> diff --git a/completion/notmuch-completion.tcsh b/completion/notmuch-completion.tcsh
> deleted file mode 100644
> index c0d3a4463555..000000000000
> --- a/completion/notmuch-completion.tcsh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -set NOTMUCH_CMD=`notmuch help | awk '/\t/' | cut -f2 |grep -v '^$'`
> -complete notmuch 'p/1/$NOTMUCH_CMD/'
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] completion: remove the broken notmuch-completion.tcsh
  2015-01-02 18:03     ` [PATCH] completion: remove the broken notmuch-completion.tcsh Jani Nikula
  2015-01-02 19:57       ` Tomi Ollila
@ 2015-01-03  8:46       ` David Bremner
  1 sibling, 0 replies; 11+ messages in thread
From: David Bremner @ 2015-01-03  8:46 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> The tcsh completion is minimal yet doesn't work at all. We're better
> off without it, it's more embarrassing than useful.

pushed

d

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

end of thread, other threads:[~2015-01-03  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 19:35 [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options Jani Nikula
2014-11-10 19:35 ` [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Jani Nikula
2014-12-31 20:36   ` David Bremner
2015-01-01 12:12     ` Tomi Ollila
2015-01-01 14:33       ` Jani Nikula
2015-01-01 14:34   ` [PATCH v2] " Jani Nikula
2015-01-02 16:22 ` [PATCH 1/2] completion: complete notmuch insert --keep and --no-hooks options David Bremner
2015-01-02 17:58   ` Jani Nikula
2015-01-02 18:03     ` [PATCH] completion: remove the broken notmuch-completion.tcsh Jani Nikula
2015-01-02 19:57       ` Tomi Ollila
2015-01-03  8:46       ` David Bremner

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).