Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: completion match ordering
- X-seq: zsh-workers 44697
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>, Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: completion match ordering
- Date: Thu, 22 Aug 2019 10:39:52 +0200
- 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=
- In-reply-to: <93343-1557177371.866119@fZLB.yW79.IWgX>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: preference=signencrypt
- 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>
unfortunately this patch (Git commit cd6fd2b0a) breaks completion for
"git commit --fixup" for me, which then looks like this:
% git commit --fixup=
-- option --
-- stage all modified and deleted paths
-- allow recording an empty commit
I hope you can reproduce this, otherwise I'd have to investigate.
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.
> 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 @@
Messages sorted by: