This function calls PROGRAM and waits for it to finish.
The current working directory of the subprocess is set to the current buffer’s value of ‘default-directory’ if that is local (as determined by ‘unhandled-file-name-directory’), or "~" otherwise. If you want to run a process in a remote directory use ‘process-file’.
The standard input for the new process comes from file INFILE if INFILE is not ‘nil’, and from the null device otherwise.
The argument DESTINATION says where to put the process output. Here are the possibilities:
Insert the output in the current buffer, before point.
Discard the output
Discard the output, and return ‘nil’ immediately without waiting for the subprocess to finish.
Send the output to the file name specified, overwriting it if it already exists.
Keep the standard output stream separate from the standard error stream; deal with the ordinary output as specified by REAL-DESTINATION, and dispose of the error output according to ERROR-DESTINATION. If ERROR-DESTINATION is ‘nil’, that means to discard the error output, ‘t’ means mix it with the ordinary output, and a string specifies a file name to redirect error output into.
You can’t directly specify a buffer to put the error output in; that is too difficult to implement. But you can achieve this result by sending the error output to a temporary file and then inserting the file into a buffer when the subprocess finishes.
If DISPLAY is non-‘nil’, then ‘call-process’ redisplays the buffer as output is inserted. Otherwise the function ‘call-process’ does no redisplay, and the results become visible on the screen only when Emacs redisplays that buffer in the normal course of events.
The remaining arguments, ARGS, are strings that specify command line arguments for the program. Each string is passed to PROGRAM as a separate argument.
The value returned by ‘call-process’ (unless you told it not to wait) indicates the reason for process termination. A number gives the exit status of the subprocess; 0 means success, and any other value means failure. If the process terminated with a signal, ‘call-process’ returns a string describing the signal. If you told ‘call-process’ not to wait, it returns ‘nil’.