From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9026 invoked by alias); 14 Sep 2016 20:32:33 -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: 21911 Received: (qmail 26227 invoked from network); 14 Sep 2016 20:32:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f46.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.46):SA:0(0.0/5.0):. Processed in 0.383955 secs); 14 Sep 2016 20:32:33 -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.46 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=CWzEVLkGlDzUy3lLEYA2cdmAVDvAY8GnkPYuOp7QEEY=; b=vMS68SK1IlUjYNcHs97BenBIz0By732D8OBZCm0cu0xTggdTLcq0S6Xfo/CtrgCdTV SnGEWXzmqSwTf1UTMIfu+d32ACjDEw+XanxHXKEGuOjHRJtAQfqDQ+djFAlXNOkunzMj lTYAkVtyLZgwgVhWDMYHASEnA5XoApdC/C81OCn2OdsYo6nEJPr6tny4y52aWM0geWRf ahaCkj1T2pZYuU8G+99IIFQHree0gWKMlmpOi9EEYWvulj4jXDb/cH4Jy5mMWYkhF31C 4N7V5+LLYixCgo2fgAQAijDq+IfJBW26N+7cTtrJNOydOtG9YRH4wFRZcXLv4wJQK2n5 1Vjw== 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=CWzEVLkGlDzUy3lLEYA2cdmAVDvAY8GnkPYuOp7QEEY=; b=bU3IGuUYsE3MFMSDz4GmXb+XPXcfU0ip/dD7YND7x1kek7F8U1+7DGnQ1/ih1n+1BW Y40F98pxGmgoqCnYNG4iucvZ505ewhEpw18R+DZjk7+lPCBQ4gZ/alOP0VCevL/fC/5R JTU/J1bPJ89szpve4FXl3rWknQ1TvkRtZqIFfJYwKS/+W7KTG+i8un948n2R+MQcLv7L r1xrabtk72ULedbD+sijh4ghTFqwHvFkKJLzaiyOMTlLvLXKtterp/X4Bn5z80xYTVQA HzKT9DlrOYP4KkkVWc5A0WwCu4bHtEup7/43hL6JisJY1czP0GxQpu7hqlmuHZRzBCOd LrBg== X-Gm-Message-State: AE9vXwPPs62CFFcCYfKgphgVfi5DN3su6rzF/cusLyrzQt6/ri/bxCk/j1kEWBwfeFlJQgaagmuRoRxKCTXoEA== X-Received: by 10.25.85.198 with SMTP id j189mr2033461lfb.31.1473885144756; Wed, 14 Sep 2016 13:32:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160914093903.ZM29711@torch.brasslantern.com> References: <75335.1473713583@hydra.kiddle.eu> <160913195916.ZM30431@torch.brasslantern.com> <160914093903.ZM29711@torch.brasslantern.com> From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Wed, 14 Sep 2016 22:32:24 +0200 Message-ID: Subject: Re: Three questions about a completer To: Zsh Users Content-Type: multipart/alternative; boundary=001a114734247e36f5053c7da069 --001a114734247e36f5053c7da069 Content-Type: text/plain; charset=UTF-8 Hmm, this was much harder than I thought. I see no difference with the addition of the compstate[insert] line. I tried this: _list-result() { print "state: " $compstate[insert] compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f ${__lsdir:-HOME}/* compstate[list]='' compstate[insert]='menu' } In fact, I have not been able to provoke a situation where the first line does not print out "state: menu". Both if I hit "" and "", what is printed is always "state: menu". On Wed, Sep 14, 2016 at 6:39 PM, Bart Schaefer wrote: > On Sep 14, 9:22am, Jesper Nygards wrote: > } > } I am getting closer: the problem with numeric is now solved with your > } suggestions, as well as turning off the listing of alternatives. However > } I still have trouble reversing the menu completion direction. > > I think all you need is this: > > _list-result() { > compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f ${__lsdir:-HOME}/* > # Even if there are multiple matches, don't list them out > compstate[list]='' > # In case we are already in the middle of a menu completion, > # ignore the compadd above and continue in the current menu > compstate[insert]='menu' > } > > It may be necessary in some edge cases to examine $compstate[insert] > and update it differently; read the doc and experiment with what the > state of $compstate[insert] is upon entry to _list-result. > --001a114734247e36f5053c7da069--