Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#455070: zsh: make completion: please add support for	-include
- X-seq: zsh-workers 24192
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: 455070@xxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#455070: zsh: make completion: please add support for	-include
- Date: Sun, 9 Dec 2007 02:36:27 +0100
- In-reply-to: <20071209012657.GC132@xxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: 455070@xxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20071208195817.GA26694@xxxxxxxxxxxxxxxxxxx> <20071208210725.GA25946@xxxxxxxxxxx> <20071209011247.GB132@xxxxxxxxxxxxxxxxxxx> <20071209012657.GC132@xxxxxxxxxxxxxxxxxxx>
On 2007-12-09 02:26:58 +0100, Vincent Lefevre wrote:
> prunille:~> incl="(-|)include"
> prunille:~> echo ${input##(-|)include ##}
> foo
> prunille:~> echo ${input##$incl ##}
> include foo
But:
prunille:~> echo ${input##${~incl} ##}
foo
The attached patch works, but I'm not sure it is correct.
-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
--- functions/Completion/Unix/_make	2007-12-09 02:08:38.000000000 +0100
+++ share/zsh/site-functions/_make	2007-12-09 02:32:49.000000000 +0100
@@ -81,8 +81,8 @@
 	    input=${input%%:*}
 	    print $(expandVars 10 $input)
 	    ;;
-	($incl *)
-	    local f=${input##$incl ##}
+	(${~incl} *)
+	    local f=${input##${~incl} ##}
 	    if [[ $incl = '.include' ]]; then
 		f=${f#[\"<]}
 		f=${f%[\">]}
@@ -125,7 +125,7 @@
 _pick_variant -r is_gnu gnu=GNU unix -v -f
 
 if [[ $is_gnu = gnu ]]; then
-    incl=include
+    incl="(-|)include"
 else
     incl=.include
 fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author