From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22461 invoked by alias); 10 Nov 2013 19:10:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18136 Received: (qmail 17752 invoked from network); 10 Nov 2013 19:10:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=wMQZb0MDwVs5RaoPF4nud6HX8nLPRY3VIU3DSbzGGnk=; b=K2IryBe7b7Mkb0j7KDC5JxuiBG82b8dQpCvj2sN7Y4QjNeizrINRVsp0cXA+KR9xN4 GtfVsmKGWFdBADtE9vZXW7V3mRCwTogi28cbDUJq/xejUodp3M1RGMeOIlKYwiqoae0S tXxgkzOKBFqTkBghLolqSQoG0WhQXmvIESUvhP3ZoFtzB74E3espRgn8gXxuFkRS9KT8 DE6NrdOvWLrEZ44NarKkY/+x95WkcrF+QDQ+KCOA9+IL/WaXURfwdSaE5AY/ediEixbE SH1B0psqWQG17lHvbDbl/Uy1y5kNnunHDpiOha49msDzkxzlyLNzWtSPiQc08bc+6pbd 81hA== X-Received: by 10.112.136.163 with SMTP id qb3mr18989644lbb.14.1384110610499; Sun, 10 Nov 2013 11:10:10 -0800 (PST) MIME-Version: 1.0 Sender: thomasballinger@gmail.com In-Reply-To: <131110102458.ZM21475@torch.brasslantern.com> References: <131110102458.ZM21475@torch.brasslantern.com> From: Thomas Ballinger Date: Sun, 10 Nov 2013 14:09:50 -0500 X-Google-Sender-Auth: FeZpu89G_BohjIXG5E_bVR-7gC0 Message-ID: Subject: Re: custom script Bash completion To: Bart Schaefer Cc: zsh-users Content-Type: multipart/alternative; boundary=089e0112c73c44cf9d04ead75db4 --089e0112c73c44cf9d04ead75db4 Content-Type: text/plain; charset=ISO-8859-1 Thanks very much Bart, I'm now using tu_completer(){ IFS=$'\n' # in loop below, iterate over lines, not words for name in $(tu --get-bash-completion "$@"); do echo $name done } because some of the suggestions contained spaces, and functionality is improved. However, completion suggestions are still filtered though by "values that the user has typed the first letters of," preventing the fuzzy completion I'd written from taking effect: tu comment jorge should result in tu comment George Washington or tu comment jorge George Washington Fred Jorrge Elizabeth George if there are multiple options, but they don't - no suggestions show up. (apparently because none of the suggestions returned by my completion script/function start with "jorge") tu comment Geo works fine. I imagine I need to turn off some zsh completion feature for this completion? Tom On Sun, Nov 10, 2013 at 1:24 PM, Bart Schaefer wrote: > On Nov 10, 11:14am, Thomas Ballinger wrote: > > > > I'd like to use bash completion in zsh for a script with > > > > complete -C 'tu --get-bash-completion' tu > > > > 'tu --get-bash-completion' is invoked by zsh completion, but the three > > arguments bash would pass to it aren't being passed. > > I'm not absolutely sure if the following explains that, because none of > the bash man pages I can find describe what those three arguments are, > but: The zsh bash completions are compatible with bash 2.05b and it is > possible that those three arguments were not passed by that version. > > Volunteers to update Completion/bashcompinit? > > > Is there another config option I need to know about, or is this behavior > > not implemented? > > Based on a quick peek at "compgen" in bashcompinit and a couple of stabs > with "complete -C /bin/echo foo" in bash itself, Thomas is expecting the > external command defined with "complete -C" to receive the same three > arguments that are passed to a shell function with "complete -F". > > So the workaround for this particular anomaly is to do > > tu_completer() { > echo $(tu --get-bash-completion "$@") > } > complete -F tu_completer tu > --089e0112c73c44cf9d04ead75db4--