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 12334431FD5 for ; Sun, 2 Feb 2014 04:54:41 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 yGayWRUC9KuZ for ; Sun, 2 Feb 2014 04:54:33 -0800 (PST) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7B450431FC0 for ; Sun, 2 Feb 2014 04:54:33 -0800 (PST) Received: by mail-ee0-f44.google.com with SMTP id c13so3121010eek.31 for ; Sun, 02 Feb 2014 04:54:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=YgIKRx1dAsYrAKu01z26Oqe8eBwDDFj1X3+N28JEkMk=; b=Hes9mNZ3xdepqyjtiuiyku19HsPjgVq/4n/N7zYv68/7kfzBBbaBRhQaAe7jbb2/qi Lovted/72ROc+jHWUlGCBAzO+C5USmmRgRUjqSvdQjfkQN5Ko8Hum8PSziAkG/SyUyon XQ1wtrAAwzVArRSau7HKhqhYFM4kJotMGASshGjGDOrHYJWJExpN3eAD6F3tq/V7jAU4 tqbC/2ln65DXENUCegkhfXIC2KxxRfH5hGkHYfmAyR/cqMkobadOECgUXeJ0YOnwjzQz RV48Y6lJ57HJS4m/qBXtd2Eqy3D8k2HbsuubmqEqSjCR924KuJICKfdWY9wwdOdVfpTR b6pw== X-Gm-Message-State: ALoCoQl4V8nvL/wNj8fx3HrXeIvR2QDJSsvKy8DETftHIgJe6CIHIyCwyGR0b24W1TKFlhWsLVqy X-Received: by 10.15.36.196 with SMTP id i44mr228166eev.104.1391345672391; Sun, 02 Feb 2014 04:54:32 -0800 (PST) Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. [88.195.111.91]) by mx.google.com with ESMTPSA id 46sm61567973ees.4.2014.02.02.04.54.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 02 Feb 2014 04:54:31 -0800 (PST) From: Jani Nikula To: Anand Buddhdev , notmuch@notmuchmail.org Subject: Re: bash completion error with 0.17 In-Reply-To: <87a9e9yeta.fsf@nikula.org> References: <87a9e9yeta.fsf@nikula.org> User-Agent: Notmuch/0.17+44~ge3b4cd9 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Sun, 02 Feb 2014 14:54:29 +0200 Message-ID: <874n4hy8sa.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain 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 12:54:41 -0000 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=()