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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 9ad04921 for ; Thu, 22 Aug 2019 08:41:40 +0000 (UTC) Received: (qmail 11058 invoked by alias); 22 Aug 2019 08:40:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44697 Received: (qmail 15203 invoked by uid 1010); 22 Aug 2019 08:40:29 -0000 X-Qmail-Scanner-Diagnostics: from hahler.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25545. spamassassin: 3.4.2. Clear:RC:0(188.40.33.212):SA:0(-1.9/5.0):. Processed in 1.511864 secs); 22 Aug 2019 08:40:29 -0000 X-Envelope-From: genml+zsh-workers@thequod.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.hahler.de designates 188.40.33.212 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=postfix2; t=1566463193; bh=SFUex2szedO1mDFHrH6EF0RN lWsVDy2b0729JX+HO6A=; b=ntYpkxGeffBhpddf6nKsLJt7Bj5jc9aUPC85EeKM 41v3MUcENgdb2qd230IltvwHPOfrpD5XA4iSKdgc8759RutNmfgQv1Tu61qzsFVQ BYjfySVidwMSLNTCfETl/57BYJWTcg9C0z5bZt+oXUdsI2653Kd7a8nn910a+/q3 L2s= Subject: Re: PATCH: completion match ordering To: Oliver Kiddle , Zsh workers References: <75B26F45-E6E6-44BB-80A4-7301CBE480FE@dana.is> <88812-1541586959.338018@YaNA.ZOZt.NKaA> <76839-1543195550.251964@c6AU.RX4q.p78d> <93343-1557177371.866119@fZLB.yW79.IWgX> From: Daniel Hahler Openpgp: preference=signencrypt Message-ID: Date: Thu, 22 Aug 2019 10:39:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <93343-1557177371.866119@fZLB.yW79.IWgX> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Hi Oliver, unfortunately this patch (Git commit cd6fd2b0a) breaks completion for "git commit --fixup" for me, which then looks like this: % git commit --fixup= --fixup -- option -- --fixup -- stage all modified and deleted paths -- allow recording an empty commit ... I hope you can reproduce this, otherwise I'd have to investigate. Best, Daniel. On 06.05.19 23:16, Oliver Kiddle wrote: > I finally got around to finishing off the changes to the options for completion > match ordering via compadd -o. Thanks to dana for reminding me about this. > > The argument to -o is now optional and can be abbreviated, e.g. -omat,rev > The sort style also accepts values like "numeric" and documentation and > tests have been added. > > _description, _all_labels etc all take -V, -1, -2 options and in the previous > patch, I had added -o to that. However, as far as I can tell that only has any > use in the case of -V because the functions need to decide whether to add -J > group or -V group. So it was only needed because the interface conflates the > use of -V - specifying the group name and making it unsorted. I guess -1 and -2 > were handled because it is common to combine them as -1V, -2J etc. Given that > it'd be useless, I decided not to add it. > > Back when sort was added to _description in 18859, it was decided to have it > explicitly ignore the style if -V was passed. While, I would tend towards the > view that it is better to give users control anyway, it remains that way for > now. You don't need to pass -V to _wanted as such. To allow the style to enable > sorting, we would need to add a compadd -o value corresponding to normal sort > order: perhaps `sort' or `lexical' (i.e. not numeric). We could then rely on > compadd honouring only the first -o option passed to it. > > The combination nosort,reverse could perhaps preserve (but reverse) the > original order. > > We could perhaps also add the backslash ignoring that dana recently restored as > an option to -o. In my testing, that patch looks good by the way - thanks dana. > > Oliver > > diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description > index 304c747a6..c2a0e080b 100644 > --- a/Completion/Base/Core/_description > +++ b/Completion/Base/Core/_description > @@ -1,13 +1,13 @@ > #autoload > …