zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@zsh.org
Subject: Re: New "make" completion (Attempt 3)
Date: Tue, 24 Nov 2009 10:37:11 +0000	[thread overview]
Message-ID: <20091124103711.7efd80c2@news01> (raw)
In-Reply-To: <200911241011.nAOABPxm024371@news01.csr.com>

On Tue, 24 Nov 2009 10:11:25 +0000
Peter Stephenson <pws@csr.com> 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 <var>= 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 <pws@csr.com>            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


      reply	other threads:[~2009-11-24 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 23:50 Michael Hwang
2009-11-24 10:11 ` Peter Stephenson
2009-11-24 10:37   ` Peter Stephenson [this message]

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=20091124103711.7efd80c2@news01 \
    --to=pws@csr.com \
    --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).