From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27713 invoked by alias); 20 Jun 2017 19:31:32 -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: 22742 Received: (qmail 17006 invoked from network); 20 Jun 2017 19:31:32 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f179.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.179):SA:0(-0.0/5.0):. Processed in 2.601353 secs); 20 Jun 2017 19:31:32 -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.179 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 :mime-version; bh=VAenNxZFNKsYNK6QJPXNvZUKZpj7fAh0kMCvEjHT/HA=; b=U+sgMwvXyOg/lg2v4R0G1QdLByapJJx/dMgLDoAwokCL/0K4XyMJzf3Z6bYIFytDtU vaebCYWht/nRCceq2TVu6wEEHTSDtCpM5Fs9JNkWhso6T3UfSYJC4f2JlXo8BY6l/e66 /MCwuc83ZZbZxBvARV0mm3Ehv5xRaDhsDVL1Kz4u6UT2zKFVKqexSs15DAXLBj3lWOZi p7N9j+hITcjWCQbxsLVfp5i2ZI+Inh8ROXbLNqSOLEXmL1y9mGU3SrU7XUwIECkn1r5w /Hv6bCZHEIeafUygWQJMXciKE+ei2z47zOuOHSr+2obSPcDIFAm7qlr8oqOKE4XUZUEV kRnw== 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:mime-version; bh=VAenNxZFNKsYNK6QJPXNvZUKZpj7fAh0kMCvEjHT/HA=; b=JCEqQqlD95lF2vwl0rF3mm/yZlZOEOJ7w57wy5sJ7e6QbOW71F7L3AjDmYeZCLRr7U 2eh8TFqVOwUCMP7WxTVPiL3/UK6f2APoUToTBgdF0aJ6a3Fz6/4Wb5cLGZ4fCzvXq+fS H99Qt6IjQ7nEe7P2jgJxSXWwezHEPEmYc3JtRy8FvIM+zUfHckI7sf9tJ7DO2Q/LjopY Be0ARxzetkOzrtEqAL4lepwCC1L2+P5hDjFGFGBVdqi2kBFecvz+LaK270qwvmwOI6QI X4ZAFo88Z0n9vAhB+q3ey8IgKHNp7K6FI7/a6ky3/l0EwbIC/leXu//3a7ZRgOzpekMO CP5A== X-Gm-Message-State: AKS2vOxRv1GsWLgQsfKDQo0F32XK0AHps7gGEzqSQz0cgEXoVmZV3Sgi yY9WG/6mfZyh8UKvJBo= X-Received: by 10.176.83.16 with SMTP id x16mr21971336uax.11.1497987083644; Tue, 20 Jun 2017 12:31:23 -0700 (PDT) From: Bart Schaefer Message-Id: <170620123215.ZM6430@torch.brasslantern.com> Date: Tue, 20 Jun 2017 12:32:15 -0700 In-Reply-To: <20170620180214.GA5281@gmx.de> Comments: In reply to Dominik Vogt "Re: Completions from file with zcompsys" (Jun 20, 7:02pm) References: <20170620074605.GA3709@gmx.de> <170620102727.ZM5792@torch.brasslantern.com> <20170620180214.GA5281@gmx.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Completions from file with zcompsys MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 20, 7:02pm, Dominik Vogt wrote: } } If a different "globbing" character would be easier to implement No, that would not be easier. } or a completely different way to allow partial searches in both } words of the plant name at the same time I can't think of anything that wouldn't require you to restructure the file e.g. with colons instead of spaces. } Trying that there is a slight problem. The file has 9529 lines; } now, when you type something like } } Chenopodium x OK, here you have two words but you haven't quoted them. So the match is going to only be on "x" -- completion is tightly bound to the shell parser idea of a "word". You need to start from $ foo 'Chenopodium x (in which case completion will supply the closing quote) or $ foo Chenopodium\ x Or you need to use a different key binding that will back up and grab both words before invoking completion. } (where no such taxon exists in the file), zsh starts gobbling 100% } cpu for about half a minute before completing an approximate } match. Yeah, approximate isn't going to deal well with that much data, it has to try multiple different substrings of the input word against every word passed to compadd. Although in the example above the fact that it is looking for every word that has something that might be mistaken for an "x" may make it worse. For this you might want to write a real function and run "agrep" or "fzf" or something like those, to pre-filter the file contents before passing to compadd. } zstyle ':completion:*' completer _complete _match _approximate } zstyle ':completion:*:match:*' original only } zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' There's a typo in that last line, there should be a space before the word "numeric".