Re: bash completion error with 0.17
authorJani Nikula <jani@nikula.org>
Sun, 2 Feb 2014 12:54:29 +0000 (14:54 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:32 +0000 (09:59 -0800)
e6/c634e68fe8dfe7017ee926f03a93af304c7859 [new file with mode: 0644]

diff --git a/e6/c634e68fe8dfe7017ee926f03a93af304c7859 b/e6/c634e68fe8dfe7017ee926f03a93af304c7859
new file mode 100644 (file)
index 0000000..8de2486
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <jani@nikula.org>\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 12334431FD5\r
+       for <notmuch@notmuchmail.org>; Sun,  2 Feb 2014 04:54:41 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yGayWRUC9KuZ for <notmuch@notmuchmail.org>;\r
+       Sun,  2 Feb 2014 04:54:33 -0800 (PST)\r
+Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com\r
+ [74.125.83.44])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 7B450431FC0   for <notmuch@notmuchmail.org>; Sun,  2 Feb 2014 04:54:33 -0800\r
+ (PST)\r
+Received: by mail-ee0-f44.google.com with SMTP id c13so3121010eek.31\r
+       for <notmuch@notmuchmail.org>; Sun, 02 Feb 2014 04:54:32 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+       :user-agent:date:message-id:mime-version:content-type;\r
+       bh=YgIKRx1dAsYrAKu01z26Oqe8eBwDDFj1X3+N28JEkMk=;\r
+       b=Hes9mNZ3xdepqyjtiuiyku19HsPjgVq/4n/N7zYv68/7kfzBBbaBRhQaAe7jbb2/qi\r
+       Lovted/72ROc+jHWUlGCBAzO+C5USmmRgRUjqSvdQjfkQN5Ko8Hum8PSziAkG/SyUyon\r
+       XQ1wtrAAwzVArRSau7HKhqhYFM4kJotMGASshGjGDOrHYJWJExpN3eAD6F3tq/V7jAU4\r
+       tqbC/2ln65DXENUCegkhfXIC2KxxRfH5hGkHYfmAyR/cqMkobadOECgUXeJ0YOnwjzQz\r
+       RV48Y6lJ57HJS4m/qBXtd2Eqy3D8k2HbsuubmqEqSjCR924KuJICKfdWY9wwdOdVfpTR\r
+       b6pw==\r
+X-Gm-Message-State:\r
+ ALoCoQl4V8nvL/wNj8fx3HrXeIvR2QDJSsvKy8DETftHIgJe6CIHIyCwyGR0b24W1TKFlhWsLVqy\r
+X-Received: by 10.15.36.196 with SMTP id i44mr228166eev.104.1391345672391;\r
+       Sun, 02 Feb 2014 04:54:32 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id 46sm61567973ees.4.2014.02.02.04.54.30\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 02 Feb 2014 04:54:31 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Anand Buddhdev <arhbkb@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: bash completion error with 0.17\r
+In-Reply-To: <87a9e9yeta.fsf@nikula.org>\r
+References:\r
+ <CANbPJF=vD8VAhGKT_3udssvApbD_W644j=4o2H8h11xZjqPphA@mail.gmail.com>\r
+       <87a9e9yeta.fsf@nikula.org>\r
+User-Agent: Notmuch/0.17+44~ge3b4cd9 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Sun, 02 Feb 2014 14:54:29 +0200\r
+Message-ID: <874n4hy8sa.fsf@nikula.org>\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: Sun, 02 Feb 2014 12:54:41 -0000\r
+\r
+On Sun, 02 Feb 2014, Jani Nikula <jani@nikula.org> wrote:\r
+> The trivial "fix" patch would likely just check for the existence of\r
+> _init_completion, and refuse to complete without it. For anything\r
+> fancier, patches welcome...\r
+\r
+The patch below would get rid of the error message (and completion, for\r
+that matter) when _init_completion is not present.\r
+\r
+I'm not sure whether this is the way to go, or should we rather check\r
+for a recent enough bash-completion during configure, or\r
+recommend/suggest it, or what. The error message does tell us what's\r
+wrong, although it's annoying for the user (probably more so than just\r
+not completing).\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+\r
+diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash\r
+index 0f13204..0c457a8 100644\r
+--- a/completion/notmuch-completion.bash\r
++++ b/completion/notmuch-completion.bash\r
+@@ -384,6 +384,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