From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28168 invoked by alias); 12 Oct 2017 17:53:20 -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: 22936 Received: (qmail 22713 invoked by uid 1010); 12 Oct 2017 17:53:20 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.26):SA:0(-2.6/5.0):. Processed in 4.693041 secs); 12 Oct 2017 17:53:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fhLTbv a694mAQnAVx86wdiP+rSjiQpez9tUTLnirVm8=; b=bK49yvmfUOj7sC4sRnJeHv RY3BJlQvg4aYssJbM48mVnt3G0x7x06xpVHSN1ziS77nOaxZBJEE/TXB3VwpraxV ezXWRplfOM3o0XlHD88ziC6AfObxLQlklEOu981uyzz00rxMIV32/eD5KzUjKyOx LT36AoMP755ierZIjyMpONouQse8gRsJh7fT6Cepx4d5NJJ93f6kj8pOjvPLkvxV HYjpmkM6IagjVEopaupAhDMtXzEdnG+QyIT7WtmW3WQEA/9cCVnHQm6qnoakkApt VsezTBpw5rinxdLkgf7X4H5FB7zwJ6RF2ZS3hLBNBqwsXF1pfgSO42abJYo68WVg == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fhLTbv a694mAQnAVx86wdiP+rSjiQpez9tUTLnirVm8=; b=MPiQMAwaywlp7OAWyQkvbx kRN+SOO0RcBWr23N3qjvniT6xzvj2JlK9GOPyGkJMIpCzv4Ql4iliFQ5s2pGk0iC daMYTYk68DxJhw38DWG6xvxNdR2+MvIcgtlUQO6YGG/4p0t7/oFXv1L+FreUQzTd KdOUAaIVjeenfdFzuyAFRbaDIaVATh0U1hq3Z5aM2ZSVoWj1rxRagif8Kb5VTqhH +TpThC7mnZQfaAzoqz6HlUb8tgO2NofGGHJN1WT2cXnPJGRCn5iefWCSv6LvM8Mc bC7w28mcaCFEIoPOYF/LP6r25DcY+MIkj/xYTL25lRMV2TKkTOQ6rRkKvZHvNPGw == X-ME-Sender: Message-Id: <1507830129.2130588.1136787904.3976E009@webmail.messagingengine.com> From: Daniel Shahaf To: Nicholas Wiles , zsh-users@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Subject: Re: Using _describe for completions. Date: Thu, 12 Oct 2017 17:42:09 +0000 References: <5CD230C2-0103-456B-A567-F63FE6CECFE1@gmail.com> In-Reply-To: <5CD230C2-0103-456B-A567-F63FE6CECFE1@gmail.com> Nicholas Wiles wrote on Thu, 12 Oct 2017 09:19 -0700: > Hello fellow users, fist time poster. I apologize if this is not the righ= t place.=20 >=20 > On zsh 5.2 I am trying to write a completion function using the _describe= builtin. >=20 > __foo_complete_func() { > list=3D(foo:'description for foo=E2=80=99 bar:'description for bar') Please don't use Unicode quotes in code samples, that makes harder to try t= hem. > _describe '=E2=80=99 list && _ret=3D0 What's this _ret thing? Your completion function is overwriting a global variable named "_ret". > } >=20 > compdef __foo_complete_func foo >=20 > When autocompleting just =E2=80=9Cfoo =E2=80=9D I get the expected: >=20 > bar -- description for bar > foo -- description for foo >=20 > However when tab completing "foo b" I get no matches shown. I don=E2=80= =99t understand why this is. I would expect to get the completion "foo bar= =E2=80=9D >=20 > Any ideas? Works for me in 'zsh -f' + 'autoload compinit; compinit' + (pasting your code) + 'foo b'. I would make the first argument to _describe non-empty just in case there's a null argument elision somewhere, but for clarity, it works for me as posted.