zsh-users
 help / color / mirror / code / Atom feed
From: Thomas Lauer <thomas.lauer@virgin.net>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: completion, sorting of options
Date: Thu, 09 Nov 2023 13:32:27 +0000	[thread overview]
Message-ID: <hinpki95a955m3r1s24a45ht65to4ojlcg@tlc.com> (raw)
In-Reply-To: <CAH+w=7bXRSr+8Q9F7YG2-smroT_ZaUU08kuWx=CJb7CzT2_54g@mail.gmail.com>

From: Bart Schaefer <schaefer@brasslantern.com>
Date: Wed, 8 Nov 2023 12:09:20 -0800

> On Wed, Nov 8, 2023 at 5:25?AM Thomas Lauer <thomas.lauer@virgin.net> wrote:
> >
> > Apparently there's no obvious solution to the zstyle "sort false/nosort"
> > thing.
> 
> The short answer here is that you can't do this with a single call to
> _arguments.  The option parsing in _arguments creates two lists, one
> of options that don't take values and one of options that do, and
> subsequently it passes them to compadd in two separate calls, so
> compadd sees them in that order even though _arguments does not.
> 
> The "simplest" thing to do here might be to make an array of the
> options that must be in a particular order, and then loop that array
> calling _arguments once for each, and then make a final call to
> _arguments with all the other specs.
> 
> > zstyle ':completion:*:*:mycmd:*:*' sort nosort_and_i_really_mean_nosort
> 
> Not likely to happen as it would mean a significant change to the deep
> guts of _arguments.

As the :-) in my message showed (or perhaps didn't) this was not really
a serious suggestion. It's just a bit frustrating that what I'd call an
implementation detail within _arguments makes this call perform in a way
a (probably naive) user doesn't expect and can't easily grok or rectify.

Anyway, thanks for the clarification.  T


  parent reply	other threads:[~2023-11-09 13:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04 15:42 Thomas Lauer
2023-11-04 15:49 ` Mikael Magnusson
2023-11-05 15:02   ` Thomas Lauer
2023-11-05 15:58     ` Bart Schaefer
2023-11-05 16:58       ` Thomas Lauer
2023-11-08 13:24 ` Thomas Lauer
2023-11-08 20:09   ` Bart Schaefer
2023-11-08 20:44     ` Ray Andrews
2023-11-08 21:34       ` Bart Schaefer
2023-11-08 22:41         ` Ray Andrews
2023-11-09 13:32     ` Thomas Lauer [this message]
2023-11-09 18:07       ` Bart Schaefer
2023-11-10 14:04         ` Thomas Lauer
2023-11-10 15:09           ` Ray Andrews
2023-11-10 17:15           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hinpki95a955m3r1s24a45ht65to4ojlcg@tlc.com \
    --to=thomas.lauer@virgin.net \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).