From: Tomi Ollila <tomi.ollila@iki.fi>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] completion: fail silently if _init_completion is not found
Date: Mon, 18 Aug 2014 20:24:33 +0300 [thread overview]
Message-ID: <m27g25r9ri.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1408379601-31994-1-git-send-email-jani@nikula.org>
On Mon, Aug 18 2014, Jani Nikula <jani@nikula.org> wrote:
> The completion script depends on bash-completion 1.90 or later, with
> _init_completion function. If that's not present, for some reason, the
> completion currently fails with an ugly message, messing up user's
> command line:
>
> $ notmuch -bash: _init_completion: command not found
>
> It's better to just not complete
>
> ---
LGTM.
Tomi
>
> This is probably unnecessary since
>
> commit aff5af582ecbacb4004ad306c6ef463d61f1ed3a
> Author: Jani Nikula <jani@nikula.org>
> Date: Sun Feb 2 18:47:57 2014 +0200
>
> configure: only install bash completion if supported
>
> but should not do harm.
> ---
> completion/notmuch-completion.bash | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
> index d88c5e7d965e..0571dc9da8e3 100644
> --- a/completion/notmuch-completion.bash
> +++ b/completion/notmuch-completion.bash
> @@ -395,6 +395,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=()
> --
> 2.0.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2014-08-18 17:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 16:33 [PATCH] completion: fail silently if _init_completion is not found Jani Nikula
2014-08-18 17:24 ` Tomi Ollila [this message]
2014-08-23 0:08 ` David Bremner
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=m27g25r9ri.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=jani@nikula.org \
--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).