zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: using the description from _arguments foo:description:->state
Date: Wed, 21 Sep 2011 13:39:07 +0200	[thread overview]
Message-ID: <17938.1316605147@thecus.kiddle.eu> (raw)
In-Reply-To: <CAHYJk3RSc0bEApiyP5+=7Sm443iemHwDb4mQ_3OfGj5vR1ivAQ@mail.gmail.com>

Mikael Magnusson wrote:
> On 11 September 2011 20:10, Bart Schaefer <schaefer@brasslantern.com>
wrote:
> > }  "($opts)-A[define widget alias]:old widget:->widget :new
widget:->widget"

> Can we add a new option to _configure which enables this, so if you
> say _arguments -d you also have to local state_descr. There's a couple
> of other variables that work like this already, -n for NORMARG, -C for
> curcontext.

While we could, there's always the possibility that some function
somewhere has a -d that's intended to me an argument to be completed.

If you used a function instead of a state, it would be called with the
relevant arguments for the description unless you prefix it with a space
in which case, you'd have to dig around in $expl. Perhaps we could use
some similar syntax to the space prefix instead of an option.

Unless you pass -C to _arguments there is the possibility of more than
one state being possible so any state_descr would need to be an array.
And we can't do arrays of arrays so a state_expl wouldn't be possible
(expl is already an array). That would put me off the whole idea somewhat.

Personally, I'd be inclined to have a separate new-widget state in this
particular function. Alternatively, you could use the value of $context
to get the right description or use a function for completing widgets.

Oliver


  reply	other threads:[~2011-09-21 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 15:04 Mikael Magnusson
2011-09-11 18:10 ` Bart Schaefer
2011-09-20 15:16   ` Mikael Magnusson
2011-09-21 11:39     ` Oliver Kiddle [this message]
2011-09-21 15:50       ` Bart Schaefer
2011-09-21 17:10         ` Oliver Kiddle
2011-09-22  4:04           ` 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=17938.1316605147@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@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).