Next: , Up: Creating Asynchronous Subprocesses   [Index]


I.1.3.1 make-process—a primitive

Function: &rest args

This function is the basic low-level primitive for starting asynchronous subprocesses. It returns a process object representing the subprocess.

Compared to the more high-level start-process, described below, it takes keyword arguments, is more flexible, and allows to specify process filters and sentinels in a single call.

ARGS

The arguments ARGS are a list of keyword/argument pairs. Omitting a keyword is always equivalent to specifying it with value ‘nil’. Here are the meaningful keywords:

:name NAME

Use the string NAME as the process name; if a process with this name already exists, then NAME is modified (by appending ‘<1>’, etc.) to be unique.

:buffer BUFFER

Use BUFFER as the process buffer. If the value is ‘nil’, the subprocess is not associated with any buffer.

:command COMMAND

Use COMMAND as the command line of the process. The value should be a list starting with the program’s executable file name, followed by strings to give to the program as its arguments. If the first element of the list is ‘nil’, Emacs opens a new pseudoterminal (pty) and associates its input and output with BUFFER, without actually running any program; the rest of the list elements are ignored in that case.

:coding CODING

If CODING is a symbol, it specifies the coding system to be used for both reading and writing of data from and to the connection. If CODING is a cons cell ‘(DECODING . ENCODING)’, then DECODING will be used for reading and ENCODING for writing. The coding system used for encoding the data written to the program is also used for encoding the command-line arguments (but not the program itself, whose file name is encoded as any other file name;

:connection-type TYPE

Initialize the type of device used to communicate with the subprocess. Possible values are ‘pty’ to use a pty, ‘pipe’ to use a pipe, or ‘nil’ to use the default derived from the value of the ‘process-connection-type’ variable. This parameter and the value of ‘process-connection-type’ are ignored if a non-‘nil’ value is specified for the ‘:stderr’ parameter; in that case, the type will always be ‘pipe’.

:noquery QUERY-FLAG

Initialize the process query flag to QUERY-FLAG.

:stop STOPPED

If STOPPED is non-‘nil’, start the process in the stopped state.

:filter FILTER

Initialize the process filter to FILTER. If not specified, a default filter will be provided, which can be overridden later.

:sentinel SENTINEL

Initialize the process sentinel to SENTINEL. If not specified, a default sentinel will be used, which can be overridden later.

:stderr STDERR

Associate STDERR with the standard error of the process. A non-‘nil’ value should be either a buffer or a pipe process created with ‘make-pipe-process’, described below.

The original argument list, modified with the actual connection information, is available via the process-contact function.

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 ~start-file-process.


Next: make-pipe-process, Up: Creating Asynchronous Subprocesses   [Index]