call-process definitely does not combine its arguments; he passes them directly to the program. To verify this, enter M-: and evaluate the following expression:
(call-process "/bin/ls" nil "*scratch*" nil "avg ba")
where "avg" and "ba" are the files in the current directory. I get the following message inserted into my zero buffer:
/bin/ls: cannot access avg ba: No such file or directory
If the invocation process reanalyzed the arguments, it would split "avg ba" into two separate arguments --- but the error message indicates that it is not.
Instead, the problem is with the shell-quote argument. When I evaluate the call that you mention in the buffer from scratch, I get the following:
(shell-quote-argument "prevdiff file.txt") "prevdiff\\ file.txt"
In other words, the p4v command actually gets what you would enter into the shell, like:
p4v -p port -u user -c client -cmd '"prevdiff file.txt"'
This is why p4v complains about "prevdiff".
So, I think what you want, namely:
"-cmd" (concat cmd " " (shell-quote-argument (buffer-name))))
(but of course check my parens).
source share