From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5960 invoked by alias); 13 Sep 2016 16:16:21 -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: 21891 Received: (qmail 19737 invoked from network); 13 Sep 2016 16:16:21 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f41.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.215.41):SA:0(0.0/5.0):. Processed in 0.388776 secs); 13 Sep 2016 16:16:21 -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=FREEMAIL_FROM,HTML_MESSAGE, SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: jesper.nygards@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.215.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ogRmpP2f7gys2JzQe7k1zejjZ3mEBNzp6DVoE4CyKVs=; b=E2548djPC1uaknHCd8aY097n9KC2OhfTrrjBDSnaLYaHKBJvzgQXZ7BvHpItGoQsih jLuGPGfazGBVKNHosqBirU9zB8ChcYv6eKKMS9xzaEFqcQMi4fq8PhpTtBR4kuR1xdpE 3OHA7q3tW0Eu9JGQuMpKTKVfWCpbm9TBBj4KJJ6xTxUadXud6lDRfwx7somEdBnt2D43 uG4dtTOVLWAFgYIrmK1VPWqZEDFYKVUYDmUXCYbkVU/e0Gk0MLJ/cGCClg5Ai0Z4GG2H QUWlno+n9GdPmA5i5uDUj9Lhp2eWbr01Eg1rp1nwFu2tYuSKiJNCl8/h4nOHjRuUqAvM FHeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ogRmpP2f7gys2JzQe7k1zejjZ3mEBNzp6DVoE4CyKVs=; b=XaaHdHyzNftTMjtIbBMuW2UaNl7o5wXU1saiDfsMyH74DHlbSLkQKJtNeiDOW8GoPl 0gWT44VKMzrJOeW8aFupd8kY8JcOno9rP1vIDr86uK+XXGLTv7pv7DO+6adCF/ai12a/ /iU01sjUZPRcBP4GN1j1P1HkRQmwV83lJWznajmUcWqg+fZFgiEClgwz3bG2ipMKMqb9 ++LD5f1tPn2Tm7h4/xm6GH8Dc8SjQeOZr/+1vOzQToLDl3eYf5wpM0Soi+m4AV2FaRjI voSjqVmcO1nHpgLNnkHYo4+IxC5YXzCWkFbutaTxMjCQ0IyDGPC2nf9nD0Scb5FRArQ8 Ncpw== X-Gm-Message-State: AE9vXwOBCkqB175xRoQxFYiWKnsdWhdTSb63SZ+YFGfdoClAPHlafq10rO7g7uxjDzz2emJbaqxxyI5xZhqhdQ== X-Received: by 10.46.69.213 with SMTP id s204mr8262828lja.67.1473783373831; Tue, 13 Sep 2016 09:16:13 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <75335.1473713583@hydra.kiddle.eu> References: <75335.1473713583@hydra.kiddle.eu> From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Tue, 13 Sep 2016 18:16:13 +0200 Message-ID: Subject: Re: Three questions about a completer To: Zsh Users Content-Type: multipart/alternative; boundary=001a114b0a547921c8053c65ee9d --001a114b0a547921c8053c65ee9d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 12, 2016 at 10:53 PM, Oliver Kiddle wrote= : > Jesper Nyg=C3=A5rds wrote: > >Again, I want to put a string on the command line, hit > > alt-e, and only those files having a part matching what i wrote should = be > > offered. If I then reverse the order, I want the same list, i.e. those > > files matching what I originally wrote. > > Using _menu generally does what I think you're describing. To use that, > you may want to use _generic instead of _list-result directly. I'd > recommend using _generic regardless of whether you want _menu, actually. > Other completers such as _match could also be useful. > > zle -C list-comp menu-complete _generic > zstyle ':completion:*list-comp::::' completer _menu _list-result > > Perhaps I am missing something obvious, but I cannot get this to work. I tried applying your suggestions, and ended up with this: _list-result() { print In _list-result local -a hlist=3D($HOME/*) compadd -n -V list_result -M 'l:|=3D* m:{[:lower:]}=3D{[:upper:]}' -- $= hlist } zle -C list-comp menu-complete _generic zle -C rev-list-comp reverse-menu-complete _generic zstyle ':completion:*list-comp::::' completer _menu _list-result bindkey '\ee' list-comp bindkey '\eE' rev-list-comp However, something is missing, because completion is not triggered. In fact, the debugging line "In _list-result" is not printed, so _list-result is never called. I assume there is something more that I need to put in place that I have missed? --001a114b0a547921c8053c65ee9d--