I'm attempting to run P4V commands directly from xemacs. After pulling in the p4.el to emacs I've written the following:
(defun p4v-command (cmd)
(get-buffer-create p4-output-buffer-name);; We do these two lines
(kill-buffer p4-output-buffer-name) ;; to ensure no duplicates
(call-process "p4v" nil (get-buffer-create p4-output-buffer-name) nil
"-p" (p4-get-p4-port)
"-u" "UserName"
"-c" (p4-current-client)
"-cmd" (shell-quote-argument (concat cmd " " (buffer-name))))
(display-buffer p4-output-buffer-name))
I'm trying to get the following for shell command (when cmd equals prevdiff):
p4v -p port -u user -c client -cmd "prevdiff file.txt"
However, when I execute the above function with prevdiff I get the following error
P4V: unrecognized argument '"prevdiff' for '-cmd' option.
So it seems that the call-process is splitting the quoted string "prevdiff file.txt" into individual arguments and P4V is processing only the first one.
This doesn't seem to happen for other commands I have tried with call-process so I'm not sure if it is a lisp problem or something to do with P4V.
Does anyone know how to resolve this?