From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2182 invoked by alias); 24 Nov 2009 10:37:30 -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: 27430 Received: (qmail 23222 invoked from network); 24 Nov 2009 10:37:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns2.melb.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 24 Nov 2009 10:37:11 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: New "make" completion (Attempt 3) Message-ID: <20091124103711.7efd80c2@news01> In-Reply-To: <200911241011.nAOABPxm024371@news01.csr.com> References: <22a0ef080911231550r315e9fc8pb1e6730ff4d464ea@mail.gmail.com> <200911241011.nAOABPxm024371@news01.csr.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Nov 2009 10:37:11.0976 (UTC) FILETIME=[14C41280:01CA6CF2] X-Scanned-By: MailControl A-09-22-03 (www.mailcontrol.com) on 10.71.0.140 On Tue, 24 Nov 2009 10:11:25 +0000 Peter Stephenson wrote: > This: > > # These are left over from the old completion. I'm not sure what they do. > #compstate[parameter]="${PREFIX%%\=*}" > #compset -P 1 '*=' > #_value "$@" > > was an attempt to complete the value of a variable, using the usual > context of parameter completion. By default you'd be able to complete > files, which was quite useful. I'll commit the following, as well > as fixing the indentation back to two spaces: On second thoughts, I don't see any point in restricting the completion of values to variables already mentioned in the Makefile; what about PATH, for example? As far as I know, make syntax is explicit that = is always parsed as an assignment, so there's no gain in dropping through to the other branch. Index: Completion/Unix/Command/_make =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_make,v retrieving revision 1.22 diff -u -r1.22 _make --- Completion/Unix/Command/_make 24 Nov 2009 10:14:33 -0000 1.22 +++ Completion/Unix/Command/_make 24 Nov 2009 10:33:40 -0000 @@ -197,7 +197,7 @@ fi fi - if [[ $PREFIX == (#b)([^=]##)'='* ]] && [[ -n ${${(k)VARIABLES}[(r)${match[1]}]} ]] + if [[ $PREFIX == *'='* ]] then # Complete make variable as if shell variable compstate[parameter]="${PREFIX%%\=*}" -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom