Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: following -C option in make completion
- X-seq: zsh-workers 45129
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: PATCH: following -C option in make completion
- Date: Sun, 22 Dec 2019 04:31:31 +0000
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- In-reply-to: <2024-1573077069.922525@CD2K.zG8N.q383>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <2024-1573077069.922525.ref@CD2K.zG8N.q383> <2024-1573077069.922525@CD2K.zG8N.q383>
Good morning Oliver,
Oliver Kiddle wrote on Wed, Nov 06, 2019 at 22:51:09 +0100:
> In the make completion, there's some very old logic for picking out the
> argument to -C. _arguments makes this rather easier if we just look in
> $opt_args and has the advantage that we can handle -Cdir and --directory
> forms (not just -C dir).
>
> This patch also uses the computed $basedir value for our view of the GNU
> make $(CURDIR) macro so it will handle include files referenced relative
> to $(CURDIR).
>
> Previously $basedir was forced into absolute form which I don't think
> gains us anything - _files -W doesn't care. Neither does finding files
> to include. But perhaps this breaks things for some form or another.
>
> I'm also not sure what the (q) modifier achieved. I've used
> ${(Q)~opt_args... so it'll expand usernames and remove a level of
> quoting. opt_args also does some extra quoting for colons which could
> also be removed. We could do with some sort of safe-eval for where
> completion functions make use of bits of the command line - expanding
> variables and named directories is useful but command-substitutions not
> so.
I've ran into a regression, and reverting this patch fixes it.
Using current master, and the following setup:
% cd "$(mktemp -d)"
% mkdir foo
The following two work:
% make -C <TAB>
[offers foo]
% make -C ./fo<TAB>
[expands to ./foo]
But the following does not:
% make -C fo<TAB>
[no matches]
It does work if I revert this patch.
WDYT?
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author