Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B7685431FD5 for ; Sun, 2 Feb 2014 06:33:37 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.798 X-Spam-Level: X-Spam-Status: No, score=-0.798 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oX7rX7zthedG for ; Sun, 2 Feb 2014 06:33:29 -0800 (PST) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 984BA431FC0 for ; Sun, 2 Feb 2014 06:33:29 -0800 (PST) Received: by mail-wg0-f52.google.com with SMTP id b13so11025958wgh.7 for ; Sun, 02 Feb 2014 06:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MHErlIMsbHzoCUYuYb3QgDYBngTI73wZEWYWgT94zfA=; b=tPdHAqAl2d3mzrtxIN6WvBSx1cSJwF8Ub+ADIuaSe7kc4GEmgFzFgQfZX39Iqc8gQa E+CgD+PeiQGB+X0VsP4czWmTPprL84+VkQ8XHarUGv0204JPpXlH2sP2YF3fyfJU0auK o07azybZuCiqjSrf6UI+wGDIzgrCT4FEjRhHmdJainKB6lpRVUqSfOs7zFOYVbIWVnXC p6jXNET9hQSn+zKOi+0cjACIcTVru/h/fh5rcMXYJkZwqUuTAum2E+fwUI0ArG495+c6 DCvHTIw34wD/n1xU/nFM5UDSzj0nN2riCLzqoE03rQF7wlv8pH1VdGCU1GHk1OLqtefF HUhg== MIME-Version: 1.0 X-Received: by 10.180.80.103 with SMTP id q7mr5691560wix.14.1391351606915; Sun, 02 Feb 2014 06:33:26 -0800 (PST) Received: by 10.227.2.9 with HTTP; Sun, 2 Feb 2014 06:33:26 -0800 (PST) In-Reply-To: <874n4hy8sa.fsf@nikula.org> References: <87a9e9yeta.fsf@nikula.org> <874n4hy8sa.fsf@nikula.org> Date: Sun, 2 Feb 2014 15:33:26 +0100 Message-ID: Subject: Re: bash completion error with 0.17 From: Anand Buddhdev To: Jani Nikula Content-Type: multipart/alternative; boundary=f46d0442834c49b9a104f16d4afd Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 14:33:37 -0000 --f46d0442834c49b9a104f16d4afd Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > On Sun, 02 Feb 2014, Jani Nikula 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=() > --f46d0442834c49b9a104f16d4afd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Jani. I've just looked at the bash-completion f= ormula 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 ve= rsion.

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


On 2 February 2014 13:54, Jani Nikula <ja= ni@nikula.org> wrote:
On Sun, 02 Feb 2014, Jani Nikula <jani@nikula.org> wrote:
> The trivial "fix" patch would likely just check for the exis= tence 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, f= or
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<= br> not completing).

BR,
Jani.



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

=A0 =A0 =A0COMPREPLY=3D()

--f46d0442834c49b9a104f16d4afd--