From: Jani Nikula <jani@nikula.org>
To: Anand Buddhdev <arhbkb@gmail.com>, notmuch@notmuchmail.org
Subject: Re: bash completion error with 0.17
Date: Sun, 02 Feb 2014 14:54:29 +0200 [thread overview]
Message-ID: <874n4hy8sa.fsf@nikula.org> (raw)
In-Reply-To: <87a9e9yeta.fsf@nikula.org>
On Sun, 02 Feb 2014, Jani Nikula <jani@nikula.org> 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=()
next prev parent reply other threads:[~2014-02-02 12:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 10:35 bash completion error with 0.17 Anand Buddhdev
2014-02-02 10:44 ` Jani Nikula
2014-02-02 10:46 ` Anand Buddhdev
2014-02-02 11:52 ` Jani Nikula
2014-02-02 12:54 ` Jani Nikula [this message]
2014-02-02 14:33 ` Anand Buddhdev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874n4hy8sa.fsf@nikula.org \
--to=jani@nikula.org \
--cc=arhbkb@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).