On Sun, 25 Mar 2007, Bram Moolenaar wrote:

You apparently really want to pass ${*} to the shell command.  The help
for makeprg explains replacing $* with the name of the file, but you use
"%" for that.

My help says that $* is replaced with the arguments, which I take to mean -T in my example:

        The placeholder "$*" can be given (even multiple times) to specify
        where the arguments will be included

It doesn't say anything about the filename. Maybe it needs to distinguish which arguments it is referring to.

This probably also works:

   setlocal makeprg=/usr/share/vim/vim70/tools/efm_perl.pl\ -c\ -w\ $*

Nope. When I replace efm_perl.pl with efm_perl2.pl, a simple script that outputs the arguments it was called with, and I have

        set makeprg=~/.vim/tools/efm_perl2.pl\ -c\ -w\ ${*}\ %

and I call ":make" on the file that I have open ('binary.pl'), efm_perl2.pl outputs

        Called with: -c -w binary.pl

When I call it with ":make -T", it outputs

        Called with: -c -w binary.pl -T

Now, if I change the makeprg thus:

        set makeprg=~/.vim/tools/efm_perl2.pl\ -c\ -w\ $*

and call ":make":

        Called with: -c -w

and ":make -T":

        Called with: -c -w -T

As you can see, the filename of the current buffer is not passed to the makeprg.

Further experimentation reveals that the order of "%\ ${*}" or "${*}\ %" makes no difference to the arguments that efm_perl2.pl is passed, nor their order. Indeed, ${*} is superfluous, but it does seem that I need % to substitute both the filename AND any arguments I give to :make.

$* and all variations of braces in and around it, just doesn't work.

        This
        option may contain '%' and '#' characters, which are expanded like
        when used in a command-line.

I think that needs explaining a bit more. To me, % is used when specifying the entire range of the file on the vim command line, and # prints lines with their respective line numbers :/

--

.

Reply via email to