unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* bash completion error with 0.17
@ 2014-02-02 10:35 Anand Buddhdev
  2014-02-02 10:44 ` Jani Nikula
  0 siblings, 1 reply; 6+ messages in thread
From: Anand Buddhdev @ 2014-02-02 10:35 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

Hi people,

I've just discovered notmuch. I've installed version 0.17 on my Mac using
Homebrew. I've also built a forked mutt with notmuch support, and I'm
exploring setting up virtual folders, and keeping all mail in a single "All
Mail" Maildir, with everything just tagged, a la Gmail :) I love it.

I have one issue to report: when I type "notmuch" at the command-line and
press tab, bash completion gives me the following error:

$ notmuch -bash: _init_completion: command not found

Looks like something is missing in the bash completion script. I'd
appreciate if someone could make a patch.

Regards,

Anand

[-- Attachment #2: Type: text/html, Size: 826 bytes --]

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

* Re: bash completion error with 0.17
  2014-02-02 10:35 bash completion error with 0.17 Anand Buddhdev
@ 2014-02-02 10:44 ` Jani Nikula
  2014-02-02 10:46   ` Anand Buddhdev
  2014-02-02 12:54   ` Jani Nikula
  0 siblings, 2 replies; 6+ messages in thread
From: Jani Nikula @ 2014-02-02 10:44 UTC (permalink / raw)
  To: Anand Buddhdev, notmuch

On Sun, 02 Feb 2014, Anand Buddhdev <arhbkb@gmail.com> wrote:
> Hi people,
>
> I've just discovered notmuch. I've installed version 0.17 on my Mac using
> Homebrew. I've also built a forked mutt with notmuch support, and I'm
> exploring setting up virtual folders, and keeping all mail in a single "All
> Mail" Maildir, with everything just tagged, a la Gmail :) I love it.
>
> I have one issue to report: when I type "notmuch" at the command-line and
> press tab, bash completion gives me the following error:
>
> $ notmuch -bash: _init_completion: command not found
>
> Looks like something is missing in the bash completion script. I'd
> appreciate if someone could make a patch.

You'll need the bash-completion package [1] too. I'm not sure about
versions, but likely reasonably recent.

The trivial "fix" patch would likely just check for the existence of
_init_completion, and refuse to complete without it. For anything
fancier, patches welcome...


BR,
Jani.


[1] http://bash-completion.alioth.debian.org/

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

* Re: bash completion error with 0.17
  2014-02-02 10:44 ` Jani Nikula
@ 2014-02-02 10:46   ` Anand Buddhdev
  2014-02-02 11:52     ` Jani Nikula
  2014-02-02 12:54   ` Jani Nikula
  1 sibling, 1 reply; 6+ messages in thread
From: Anand Buddhdev @ 2014-02-02 10:46 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

Hi Jani,

I already have bash-completion installed, although it's version 1.3.


On 2 February 2014 11:44, Jani Nikula <jani@nikula.org> wrote:

> On Sun, 02 Feb 2014, Anand Buddhdev <arhbkb@gmail.com> wrote:
> > Hi people,
> >
> > I've just discovered notmuch. I've installed version 0.17 on my Mac using
> > Homebrew. I've also built a forked mutt with notmuch support, and I'm
> > exploring setting up virtual folders, and keeping all mail in a single
> "All
> > Mail" Maildir, with everything just tagged, a la Gmail :) I love it.
> >
> > I have one issue to report: when I type "notmuch" at the command-line and
> > press tab, bash completion gives me the following error:
> >
> > $ notmuch -bash: _init_completion: command not found
> >
> > Looks like something is missing in the bash completion script. I'd
> > appreciate if someone could make a patch.
>
> You'll need the bash-completion package [1] too. I'm not sure about
> versions, but likely reasonably recent.
>
> The trivial "fix" patch would likely just check for the existence of
> _init_completion, and refuse to complete without it. For anything
> fancier, patches welcome...
>
>
> BR,
> Jani.
>
>
> [1] http://bash-completion.alioth.debian.org/
>

[-- Attachment #2: Type: text/html, Size: 1895 bytes --]

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

* Re: bash completion error with 0.17
  2014-02-02 10:46   ` Anand Buddhdev
@ 2014-02-02 11:52     ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2014-02-02 11:52 UTC (permalink / raw)
  To: Anand Buddhdev; +Cc: notmuch

On Sun, 02 Feb 2014, Anand Buddhdev <arhbkb@gmail.com> wrote:
> Hi Jani,
>
> I already have bash-completion installed, although it's version 1.3.

At a glance, it seems _init_completion was introduced in bash-completion
1.90:

http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=32dbe76784acc39b17ee9ca7bc21c28f4f2b23b5

$ git tag --contains 32dbe76784acc39b17ee9ca7bc21c28f4f2b23b5
1.90
1.99
2.0
2.1


BR,
Jani.


>
>
> On 2 February 2014 11:44, Jani Nikula <jani@nikula.org> wrote:
>
>> On Sun, 02 Feb 2014, Anand Buddhdev <arhbkb@gmail.com> wrote:
>> > Hi people,
>> >
>> > I've just discovered notmuch. I've installed version 0.17 on my Mac using
>> > Homebrew. I've also built a forked mutt with notmuch support, and I'm
>> > exploring setting up virtual folders, and keeping all mail in a single
>> "All
>> > Mail" Maildir, with everything just tagged, a la Gmail :) I love it.
>> >
>> > I have one issue to report: when I type "notmuch" at the command-line and
>> > press tab, bash completion gives me the following error:
>> >
>> > $ notmuch -bash: _init_completion: command not found
>> >
>> > Looks like something is missing in the bash completion script. I'd
>> > appreciate if someone could make a patch.
>>
>> You'll need the bash-completion package [1] too. I'm not sure about
>> versions, but likely reasonably recent.
>>
>> The trivial "fix" patch would likely just check for the existence of
>> _init_completion, and refuse to complete without it. For anything
>> fancier, patches welcome...
>>
>>
>> BR,
>> Jani.
>>
>>
>> [1] http://bash-completion.alioth.debian.org/
>>

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

* Re: bash completion error with 0.17
  2014-02-02 10:44 ` Jani Nikula
  2014-02-02 10:46   ` Anand Buddhdev
@ 2014-02-02 12:54   ` Jani Nikula
  2014-02-02 14:33     ` Anand Buddhdev
  1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2014-02-02 12:54 UTC (permalink / raw)
  To: Anand Buddhdev, notmuch

On Sun, 02 Feb 2014, Jani Nikula <jani@nikula.org> wrote:
> The trivial "fix" patch would likely just check for the existence of
> _init_completion, and refuse to complete without it. For anything
> fancier, patches welcome...

The patch below would get rid of the error message (and completion, for
that matter) when _init_completion is not present.

I'm not sure whether this is the way to go, or should we rather check
for a recent enough bash-completion during configure, or
recommend/suggest it, or what. The error message does tell us what's
wrong, although it's annoying for the user (probably more so than just
not completing).

BR,
Jani.



diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 0f13204..0c457a8 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -384,6 +384,10 @@ _notmuch()
 {
     local _notmuch_commands="compact config count dump help insert new reply restore search setup show tag"
     local arg cur prev words cword split
+
+    # require bash-completion with _init_completion
+    type -t _init_completion >/dev/null 2>&1 || return
+
     _init_completion || return
 
     COMPREPLY=()

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

* Re: bash completion error with 0.17
  2014-02-02 12:54   ` Jani Nikula
@ 2014-02-02 14:33     ` Anand Buddhdev
  0 siblings, 0 replies; 6+ messages in thread
From: Anand Buddhdev @ 2014-02-02 14:33 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]

Thanks Jani. I've just looked at the bash-completion formula on Homebrew.
It says that bash-completion 2.0 and above needs bash4, but the current
version of OSX, 10.9, still has bash 3.2, which is why, at least under
Homebrew, we can't update bash-completion to the latest version.

I think your patch probably makes sense. Once a user updates to a newer
bash-completion, it will just begin working, while for users like me, the
error message goes away.


On 2 February 2014 13:54, Jani Nikula <jani@nikula.org> wrote:

> On Sun, 02 Feb 2014, Jani Nikula <jani@nikula.org> wrote:
> > The trivial "fix" patch would likely just check for the existence of
> > _init_completion, and refuse to complete without it. For anything
> > fancier, patches welcome...
>
> The patch below would get rid of the error message (and completion, for
> that matter) when _init_completion is not present.
>
> I'm not sure whether this is the way to go, or should we rather check
> for a recent enough bash-completion during configure, or
> recommend/suggest it, or what. The error message does tell us what's
> wrong, although it's annoying for the user (probably more so than just
> not completing).
>
> BR,
> Jani.
>
>
>
> diff --git a/completion/notmuch-completion.bash
> b/completion/notmuch-completion.bash
> index 0f13204..0c457a8 100644
> --- a/completion/notmuch-completion.bash
> +++ b/completion/notmuch-completion.bash
> @@ -384,6 +384,10 @@ _notmuch()
>  {
>      local _notmuch_commands="compact config count dump help insert new
> reply restore search setup show tag"
>      local arg cur prev words cword split
> +
> +    # require bash-completion with _init_completion
> +    type -t _init_completion >/dev/null 2>&1 || return
> +
>      _init_completion || return
>
>      COMPREPLY=()
>

[-- Attachment #2: Type: text/html, Size: 2334 bytes --]

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

end of thread, other threads:[~2014-02-02 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02 10:35 bash completion error with 0.17 Anand Buddhdev
2014-02-02 10:44 ` Jani Nikula
2014-02-02 10:46   ` Anand Buddhdev
2014-02-02 11:52     ` Jani Nikula
2014-02-02 12:54   ` Jani Nikula
2014-02-02 14:33     ` Anand Buddhdev

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