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