From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15248 invoked by alias); 20 Jun 2017 17:26:43 -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: 22740 Received: (qmail 15718 invoked from network); 20 Jun 2017 17:26:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f181.google.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(209.85.217.181):SA:0(-0.0/5.0):. Processed in 2.586567 secs); 20 Jun 2017 17:26:43 -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=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.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.217.181 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=khLQm80V9wRXwtyBhMnlK+Zb+aVdOJcILvA8grhetr4=; b=uoz+UIjc9UUKRJrboQ4/oNsEItQbiSUXYB3/pw3WumgtQUuSkd05HckPpu/WDqdemN mxoFdTNrV3Fsru0Oo0gzd2Cqz/K8nOYvDAyCrFkL4fZT1zBuj+ntHy8QauqLuZKJZwLL T+74NBUB550knQB3W8213F6FRMFKFb34uHH6uBNMlEFMsx5Q7tac8Yw2uq/0Ve+VuDr7 /ueRwY9ZkZkrIlaq3vggoE3InpuZKAbFe0bjssr3HyC5jUuDfzZ52qjcpLAwqO1qPhYY bS4TeHceRB3qOXx/O+1TuDCGLgtJRZFPMyZcv7P+Ev/FAxg66BN3stkx/qvWARvTDvH3 PdzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:cc:mime-version; bh=khLQm80V9wRXwtyBhMnlK+Zb+aVdOJcILvA8grhetr4=; b=FZkZvIeF1YoijsfH9N+CxdvhwIKxfxl0IkOs66TIjIPJaCnMg2INfUozCvi7DBKxRK T8uopdkZD2PHS84IC2BIXmIvL2rhOextr+oNOdImsBXOM5FWDxs5lgW0nh/yWAXpALkJ yoCgrVUIf5v9IfcWphi7vhg20sTwmOrDsjrAG9JNnEZ1JhKndq/dk0fDTRxnpdbo4fjR 3LpVto5DfFOOZMraPmOJr094ETsCendaFgFpEq25T3Sntj0bQpJcK5epFHbcCZnRYa7J ZKIG2SXDS0emZ59k8EmyHzI2AcWQFJ2RHTmYSFCGDh4t9kRG1gI3OrOaeq9b+HsuxD15 +xLg== X-Gm-Message-State: AKS2vOw6f1IUVFP6FHHjWpEyIjHxCPgdji7xK3PhfV9G1s2RvUktFWAM It7CXIWZPHLeYpPmyX0= X-Received: by 10.176.91.209 with SMTP id z17mr20777460uae.49.1497979595925; Tue, 20 Jun 2017 10:26:35 -0700 (PDT) From: Bart Schaefer Message-Id: <170620102727.ZM5792@torch.brasslantern.com> Date: Tue, 20 Jun 2017 10:27:27 -0700 In-Reply-To: <20170620074605.GA3709@gmx.de> Comments: In reply to Dominik Vogt "Completions from file with zcompsys" (Jun 20, 8:46am) References: <20170620074605.GA3709@gmx.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org, zsh-users@zsh.org Subject: Re: Completions from file with zcompsys Cc: dominik.vogt@gmx.de MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 20, 8:46am, Dominik Vogt wrote: } } Are there some quick instructions instructions or a } cheat sheet on the new completion system somewhere? http://zsh.sourceforge.net/Guide/zshguide06.html#l144 (perhaps?) } And I want to type things like } } $ foo Chenoalb # -> Chenopodium album } $ foo Che*a # -> Chenopodium a } } (using menu completion, not expanding the * to all matching } completions). The latter one could be tricky because you will have to prevent the "*" from being expanded as a file glob. Do you want the expansions exactly as you wrote them, or should the spaces be quoted? E.g. do you want to end up with something like one of $ foo 'Chenopodium album' $ foo Chenopodium\ album <-- this one is the easy one below or instead $ foo Chenopodium album ?? The latter will be a bit more work because you will have to account for the first word when completing the second word. In any case, the procedure is to create a function that produces a list of words and then passes them to the "compadd" builtin. The list does not have to be filtered against the command line (except in the "a bit more work" case I just mentioned) because compadd will take care of that part. Then you pass the names of that function and of the command to the "compdef" function. You can also pass a string to be eval'd to compdef, so the simplest answer to your question is (guessing at a file name) compdef 'compadd ${(f)"$(<~/latin-plant-names.txt)"}' foo Then to get the "*"-expansion you will need to add the _match function to your completer zstyle. Example might be zstyle ':completion:*' completer _complete _match but adjust the placement of _match to fit whatever your current list of completers contains. It would normally be anywhere after _complete. If the above doesn't satisfy, we can go into more detail about how to change or remove the quoting.