Skip to main content

38 Processes

In the terminology of operating systems, a process is a space in which a program can execute. Emacs runs in a process. Emacs Lisp programs can invoke other programs in processes of their own. These are called subprocesses or child processes of the Emacs process, which is their parent process.

A subprocess of Emacs may be synchronous or asynchronous, depending on how it is created. When you create a synchronous subprocess, the Lisp program waits for the subprocess to terminate before continuing execution. When you create an asynchronous subprocess, it can run in parallel with the Lisp program. This kind of subprocess is represented within Emacs by a Lisp object which is also called a “process". Lisp programs can use this object to communicate with the subprocess or to control it. For example, you can send signals, obtain status information, receive output from the process, or send input to it.

In addition to processes that run programs, Lisp programs can open connections of several types to devices or processes running on the same machine or on other machines. The supported connection types are: TCP and UDP network connections, serial port connections, and pipe connections. Each such connection is also represented by a process object.

function processp object

This function returns t if object represents an Emacs process object, nil otherwise. The process object can represent a subprocess running a program or a connection of any supported type.

In addition to subprocesses of the current Emacs session, you can also access other processes running on your machine. See System Processes.

Subprocess Creation  Functions that start subprocesses.
Shell Arguments  Quoting an argument to pass it to a shell.
Synchronous Processes  Details of using synchronous subprocesses.
Asynchronous Processes  Starting up an asynchronous subprocess.
Deleting Processes  Eliminating an asynchronous subprocess.
Process Information  Accessing run-status and other attributes.
Input to Processes  Sending input to an asynchronous subprocess.
Signals to Processes  Stopping, continuing or interrupting an asynchronous subprocess.
Output from Processes  Collecting output from an asynchronous subprocess.
Sentinels  Sentinels run when process run-status changes.
Query Before Exit  Whether to query if exiting will kill a process.
System Processes  Accessing other processes running on your system.
Transaction Queues  Transaction-based communication with subprocesses.
Network  Opening network connections.
Network Servers  Network servers let Emacs accept net connections.
Datagrams  UDP network connections.
Low-Level Network  Lower-level but more general function to create connections and servers.
Misc Network  Additional relevant functions for net connections.
Serial Ports  Communicating with serial ports.
Byte Packing  Using bindat to pack and unpack binary data.