Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: following -C option in make completion



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