From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 547 invoked by alias); 4 Jun 2011 12:39:57 -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: 29456 Received: (qmail 17814 invoked from network); 4 Jun 2011 12:39:56 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BLEF890B3r92JFXOCcAVpFUGsi5nghJLqpCHFOab1Nc=; b=YEG/SQjQ2oBp7plUHL8fQUwC8J3pyVGyeH+sS8iatP4N1EDiftY76D0em190NvM8XN CBTCiRtylJq8AW50YNppWQZ0P1TuFm05oRsPZ24+FxNneCf9UdhHhJQ0Rw924i1sv6+2 J57i2xfjrTumFDYKH4nEhDY4XSaQMxYMyhUFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XiDjLBWtwuaCoN5bXXjVRxFN5FV2Fc49tfoIkh9f1yz+Qa4lgqCJhNahOndfub8Qxt TxixR1Jxk05M4eRwzwk2K1zlXp45ZAJjNl7YIXKooOKXbS7LgujS5ytnYi2L3WCCwr6N SgYtqNXNPXlMQ+5xwBeY0cbAJ2k5UH10qnvbQ= MIME-Version: 1.0 In-Reply-To: <20110603215453.1260c7f0@pws-pc.ntlworld.com> References: <20110603215453.1260c7f0@pws-pc.ntlworld.com> Date: Sat, 4 Jun 2011 14:39:52 +0200 Message-ID: Subject: Re: PATCH: completion for parameter flags From: Mikael Magnusson To: Peter Stephenson Cc: "Zsh Hackers' List" Content-Type: text/plain; charset=UTF-8 On 3 June 2011 22:54, Peter Stephenson wrote: > It has not hitherto been possible to complete parameter flags because > "${(" is not treated as a suitable location for parameter completion, > so you drop through to ordinary argument-context completion. > > It turns out it's quite easy to detect the unbalanaced open parenthesis; > indeed, the context check for parameters already does, carefully > remembers the fact, carefully does some more checking, and then > carefully remembers that all that extra checking was pointless. I'm not > sure why it goes to those lengths, but experimentation suggests simply > noting that we're in a brace parameter and not bothering with the code to > deal with parameter names gives us enough for the _brace_parameter > function to pick up on. > > So here is some brief C code and an expanded shell function for > parameter flag completion. This looks nicer than the hack I posted, but "${( shows me glob qualifiers. (Ie, with the leading quotemark). foo${( does nothing at all. (---- no match for: `parameter' or `corrections') -- Mikael Magnusson