From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=FREEMAIL_FROM, FROM_EXCESS_BASE64,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 2a3d9630 for ; Thu, 8 Aug 2019 13:51:02 +0000 (UTC) Received: (qmail 4354 invoked by alias); 8 Aug 2019 13:50:38 -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: List-Unsubscribe: X-Seq: 24136 Received: (qmail 5442 invoked by uid 1010); 8 Aug 2019 13:50:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk1-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25531. spamassassin: 3.4.2. Clear:RC:0(209.85.222.172):SA:0(-1.4/5.0):. Processed in 1.650512 secs); 08 Aug 2019 13:50:38 -0000 X-Envelope-From: arkanosis@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.222.172 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9G55b85/s/4VllgirWMDSW6MrzvBiGIICXlThaoLe3Q=; b=eUEy7bfsOH8WegAubH0FkbSf4/o8wDSTIy7FRlaPUR5sVmZhgx06rkrT52p0KXqw/u FgzJtgapxkIYOTTBfm+F1ht/TY8wB7t559HpHKNFhSuffdMgWfA6Im3a7cJaS7k6Ucte RTsq62LRQBkV6TvRWpYRGp//EcAft751kdP7luzVBufawQuUSOa/JXy7C0batzwJb2gE NAGfw+tru9ND2GAS6UWn0E6XM8JFnaRykCNKy0QcDIx3qSkxgtyPS7Y/ijlMCGLLThdU GyaAsKHYOEqp5Q0QPBiz4Z7NH5LV1uvpCiOGAFlA/FbrQyX/aIS/oOPNKEPUPRWUwBPL 1I9A== X-Gm-Message-State: APjAAAX50gAzkCDdk4cUSfphA/aRtIFf3CUKSWZjmGKkLXNTxULpOBIO CUyDLOzcficScdOUENqmjz3jq9VAC474u7GjnjQ= X-Google-Smtp-Source: APXvYqzpMKCg+vxIm33qJrZf9LzUQ5KZ5OAR8SwwHBSA5sN7vRFV2MpHgPN81mEf3qR4HDURkH2lvo5HV6rTwnj3gDY= X-Received: by 2002:ae9:ed94:: with SMTP id c142mr1284651qkg.70.1565272203777; Thu, 08 Aug 2019 06:50:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Thu, 8 Aug 2019 15:49:52 +0200 Message-ID: Subject: Re: completion for function arguments? To: TJ Luoma Cc: Zsh MailingList Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le jeu. 8 ao=C3=BBt 2019 =C3=A0 15:08, TJ Luoma a =C3=A9= crit : > Let me start by saying that I don't understand completion at all, So, let's start by saying that I don't understand them much either, and that someone will probably suggest something much simpler using zstyle. > I have a function called 'jump' which I will include below. > The function takes one (1) argument from a specific list of arguments. The following should work: _jump() { local targets=3D(macbook imac tyrion) _wanted jump_target expl 'Jump target' compadd -a targets } compdef _jump jump Note that you can achieve the same effect by just putting the following in a file named _jump somewhere in your $fpath: #compdef jump local targets=3D(macbook imac tyrion) _wanted jump_target expl 'Jump target' compadd -a targets As I said, it should work, but there are probably much nicer ways to achieve the same result. Best regards, --=20 J=C3=A9r=C3=A9mie