From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12474 invoked by alias); 21 Sep 2011 11:45:22 -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: X-Seq: 29790 Received: (qmail 5967 invoked from network); 21 Sep 2011 11:45:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1316605148; bh=TBfksGsB4gtfsRw5rl/PmfVzjDOQ69svIT2LNKRI7SM=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=rbnY85EhQgIxUxmLwDqwA89fh4hZTl1K52KV1Ca+BO6i9pgvZ1gxNDgZ06Gd8gDGKMCODMTviwN9PyRElEl0T8LIiaq+v5sQsjLCN+0y8Ld/39rIKui3JumoOxpUcxl52eD81vQ+WpUw6fB4AGjizUeh+Cu1CdH9slWVVJturiM= X-Yahoo-Newman-Id: 555144.47604.bm@smtp131.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: tlHCA6sVM1l03zKgusEC9W4v8iPoHdFXb0J7nBDPwzT5jAE P_vBZ3Sv4h6v5wqi.ckc29SsBzKdXRECIE.vStiMZ.YQljVZcZFcUEZU.Aei Vd0dwa_Ol6MojWpvrUYbvBosWDfC1pzbq5C7xNbuggd81WjdkcXSNCd171CI izPKWXmsPWReq2TcJMPt0eIRS4Yv0Hdhu4v.0LECIjBbNAgWkIiGrSRVh97Y amouo7phYKJwRXLaAz5jasZjm5zf4wTpZ7CA2XfFs3egJLh_iPHCtWS_f4C1 BXfV6CP2Gb8GcFAfYyXMJKQBcMA.Rl5NqtsjerSnuLeWlsxFFEUAWPJQL8nX qfU7qzuNcToyE0i2g4v8bzc0DdPcebaGVSXcUYkWFhg-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: From: Oliver Kiddle References: <110911111050.ZM11625@torch.brasslantern.com> To: zsh workers Subject: Re: using the description from _arguments foo:description:->state Date: Wed, 21 Sep 2011 13:39:07 +0200 Message-ID: <17938.1316605147@thecus.kiddle.eu> Mikael Magnusson wrote: > On 11 September 2011 20:10, Bart Schaefer 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