From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24200 invoked by alias); 11 Oct 2017 17:54:52 -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: 22930 Received: (qmail 14527 invoked by uid 1010); 11 Oct 2017 17:54:52 -0000 X-Qmail-Scanner-Diagnostics: from out1-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.25):SA:0(-2.6/5.0):. Processed in 3.627565 secs); 11 Oct 2017 17:54:52 -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=seVxO6 Ch7UBzpPc+ExkfzfQ/k1TJg++/i424KZxm9K0=; b=SkJvVq2BaQTPsjao6LO4hr oHHatj9aeJfC1uqfHBACVr36ZXPZjQCgCFZV0937gPyrCzHaQfa5Vb0tD6UaRHGx +DXq1HgS1kdcLWvDih86PYniBSSNDIE7MqqX3ssqtHPXd8wxNZsvDNWcJl4p6XGn 2l1fV4OhlLNHtLlOS13ZJK7eiKnAjQGRDS80DKdGassf/s4XOgs4IzgOGFqGpNr7 Z37hPAA+o/e4IZ8J3Fr/1FC9AUPnex460l3LGh1EZcCH19ar/ohVDmP4tmkEahDA ERoigs5XOxNTstbz0ZxsjCLvjjd/cHElUv918GfXIDqwyiuP8IUimCtedGB/Xn2A == 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=seVxO6 Ch7UBzpPc+ExkfzfQ/k1TJg++/i424KZxm9K0=; b=gR92z973/iGK2WtNcQznHr VULH7hMF8lQjG8r6oCtGyH2n/MsrOqKez6vlramtlx36toj4kmzDyeHQr9mEoJVI CuxymSEWyfUy+cMckmD9shYo/a+nGKj6wr7PKaj86mxdSAERz0+oCCD3stWYa/n6 MUGt315fNjp6wZ5Dp0o8av1ACPayJgg5o4Q7WZndMquruWbaEqa92ba3RR280pbE 5HxInOtWIe/TvjQh0ybmPc/XAH+lsFFDzXKRfET1i2+3zlJnhH/tq0kPVkVcLa7Q 2PIHWebbOjNBYIVTA68K2yoYvoNHwTz+Br7wVSSQcq9PSqGRYqYYNvQPuppKnkiw == X-ME-Sender: Message-Id: <1507744483.3516251.1135548216.7E11AFA9@webmail.messagingengine.com> From: Daniel Shahaf To: Filipe Silva , Zsh Users MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Date: Wed, 11 Oct 2017 17:54:43 +0000 References: In-Reply-To: Subject: Re: trouble trying to understand zsh's completion system Filipe Silva wrote on Wed, 11 Oct 2017 07:37 -0300: > So I saved this file as _gocomp in a directory: > > #compdef go > > local -a options > options=('run:description for run' 'build:description for build') > _describe 'values' options > > after $ fpath=($(readlink -f .) $fpath) and autload -U _gocomp, I try to > type go [TAB]. zsh greets me with `go _gocomp`. > > What am I doing wrong? You aren't making the link between the command "go" and the autoloadable function "_gocomp". You can do that either by running compinit after changing fpath (then you don't need to run autoload explicitly) or by running 'compdef _gocomp go' in addition to what you're running. It completes "_gocomp" because that's the only file in the current directory. (_files is the default completion) Minimal example: zsh -f autoload compinit compinit _foo() { compadd bar } compdef _foo foo foo Cheers, Daniel