Re: [PATCH] completion: fail silently if _init_completion is not found
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 18 Aug 2014 17:24:33 +0000 (20:24 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:14 +0000 (10:04 -0800)
f9/d40f93745b91c59603cff3160dafe33563659a [new file with mode: 0644]

diff --git a/f9/d40f93745b91c59603cff3160dafe33563659a b/f9/d40f93745b91c59603cff3160dafe33563659a
new file mode 100644 (file)
index 0000000..dc2a889
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 177C8431FBC\r
+       for <notmuch@notmuchmail.org>; Mon, 18 Aug 2014 10:25:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 3lz49LhVpfnW for <notmuch@notmuchmail.org>;\r
+       Mon, 18 Aug 2014 10:24:52 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9499F431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 18 Aug 2014 10:24:52 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id A01B61000C1;\r
+       Mon, 18 Aug 2014 20:24:33 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] completion: fail silently if _init_completion is not\r
+ found\r
+In-Reply-To: <1408379601-31994-1-git-send-email-jani@nikula.org>\r
+References: <1408379601-31994-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.18.1+76~g581776d (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 18 Aug 2014 20:24:33 +0300\r
+Message-ID: <m27g25r9ri.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 18 Aug 2014 17:25:00 -0000\r
+\r
+On Mon, Aug 18 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> The completion script depends on bash-completion 1.90 or later, with\r
+> _init_completion function. If that's not present, for some reason, the\r
+> completion currently fails with an ugly message, messing up user's\r
+> command line:\r
+>\r
+> $ notmuch -bash: _init_completion: command not found\r
+>\r
+> It's better to just not complete\r
+>\r
+> ---\r
+\r
+LGTM.\r
+\r
+Tomi\r
+\r
+\r
+>\r
+> This is probably unnecessary since\r
+>\r
+> commit aff5af582ecbacb4004ad306c6ef463d61f1ed3a\r
+> Author: Jani Nikula <jani@nikula.org>\r
+> Date:   Sun Feb 2 18:47:57 2014 +0200\r
+>\r
+>     configure: only install bash completion if supported\r
+>\r
+> but should not do harm.\r
+> ---\r
+>  completion/notmuch-completion.bash | 4 ++++\r
+>  1 file changed, 4 insertions(+)\r
+>\r
+> diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash\r
+> index d88c5e7d965e..0571dc9da8e3 100644\r
+> --- a/completion/notmuch-completion.bash\r
+> +++ b/completion/notmuch-completion.bash\r
+> @@ -395,6 +395,10 @@ _notmuch()\r
+>  {\r
+>      local _notmuch_commands="compact config count dump help insert new reply restore search setup show tag"\r
+>      local arg cur prev words cword split\r
+> +\r
+> +    # require bash-completion with _init_completion\r
+> +    type -t _init_completion >/dev/null 2>&1 || return\r
+> +\r
+>      _init_completion || return\r
+>  \r
+>      COMPREPLY=()\r
+> -- \r
+> 2.0.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r