* Re: Bug#455070: zsh: make completion: please add support for -include
[not found] <20071208195817.GA26694@vin.lip.ens-lyon.fr>
@ 2007-12-08 21:07 ` Clint Adams
2007-12-09 1:12 ` Vincent Lefevre
0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2007-12-08 21:07 UTC (permalink / raw)
To: Vincent Lefevre, 455070; +Cc: zsh-workers
On Sat, Dec 08, 2007 at 08:58:17PM +0100, Vincent Lefevre wrote:
> As shown below, "make" completion supports "include",
> but not "-include".
>
> vin:~> head -99 Makefile*
> ==> Makefile <==
> test.b: test.a
> touch $@
>
> include Makefile-2
>
> -include Makefile-3
>
> ==> Makefile-2 <==
> test.c: test.b
> touch $@
>
> ==> Makefile-3 <==
> test.d: test.c
> touch $@
> vin:~> make [TAB]
> Completing make target
> test.b test.c
Could you give this completely-untested patch a try?
Index: Completion/Unix/Command/_make
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_make,v
retrieving revision 1.19
diff -u -r1.19 _make
--- Completion/Unix/Command/_make 10 Nov 2006 09:59:27 -0000 1.19
+++ Completion/Unix/Command/_make 8 Dec 2007 21:06:29 -0000
@@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bug#455070: zsh: make completion: please add support for -include
2007-12-08 21:07 ` Bug#455070: zsh: make completion: please add support for -include Clint Adams
@ 2007-12-09 1:12 ` Vincent Lefevre
2007-12-09 1:26 ` Vincent Lefevre
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Lefevre @ 2007-12-09 1:12 UTC (permalink / raw)
To: 455070, zsh-workers
On 2007-12-08 16:07:25 -0500, Clint Adams wrote:
> Could you give this completely-untested patch a try?
It doesn't work. "include" is even no longer matched.
--
Vincent Lefèvre <vincent@vinc17.org> - 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bug#455070: zsh: make completion: please add support for -include
2007-12-09 1:12 ` Vincent Lefevre
@ 2007-12-09 1:26 ` Vincent Lefevre
2007-12-09 1:36 ` Vincent Lefevre
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Lefevre @ 2007-12-09 1:26 UTC (permalink / raw)
To: 455070, zsh-workers
On 2007-12-09 02:12:47 +0100, Vincent Lefevre wrote:
> On 2007-12-08 16:07:25 -0500, Clint Adams wrote:
> > Could you give this completely-untested patch a try?
>
> It doesn't work. "include" is even no longer matched.
If I understand the zshexpn(1) man page[*] correctly (but it is not
clear about how the parameter expansion is done in the pattern field),
I think this is a bug:
prunille:~> incl="(-|)include"
prunille:~> echo ${input##(-|)include ##}
foo
prunille:~> echo ${input##$incl ##}
include foo
[*]
In the expansions discussed below that require a pattern, the form of
the pattern is the same as that used for filename generation; see the
section `Filename Generation'. Note that these patterns, along with
the replacement text of any substitutions, are themselves subject to
parameter expansion, command substitution, and arithmetic expansion.
--
Vincent Lefèvre <vincent@vinc17.org> - 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bug#455070: zsh: make completion: please add support for -include
2007-12-09 1:26 ` Vincent Lefevre
@ 2007-12-09 1:36 ` Vincent Lefevre
0 siblings, 0 replies; 4+ messages in thread
From: Vincent Lefevre @ 2007-12-09 1:36 UTC (permalink / raw)
To: 455070, zsh-workers
[-- Attachment #1: Type: text/plain, Size: 515 bytes --]
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@vinc17.org> - 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)
[-- Attachment #2: _make.diff --]
[-- Type: text/plain, Size: 566 bytes --]
--- 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-09 1:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20071208195817.GA26694@vin.lip.ens-lyon.fr>
2007-12-08 21:07 ` Bug#455070: zsh: make completion: please add support for -include Clint Adams
2007-12-09 1:12 ` Vincent Lefevre
2007-12-09 1:26 ` Vincent Lefevre
2007-12-09 1:36 ` Vincent Lefevre
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).