package ecaml

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ecaml.ProcessSource

Process is used to create "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 program waits for the subprocess to terminate before continuing execution. When you create an asynchronous subprocess, it can run in parallel with Emacs. This kind of subprocess is represented within Emacs by a Process.t. 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.

(Info-goto-node "(elisp)Processes").

Sourcetype t
include Core.Equal.S with type t := t
include Ecaml_value.Value.Subtype with type t := t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval eq : t -> t -> bool

eq t1 t2 = Value.eq (to_value t1) (to_value t2), i.e. eq checks whether the Emacs values underlying t1 and t2 are physically equal. This is different than phys_equal t1 t2, because we don't always wrap eq Emacs values in phys_equal OCaml values. I.e. phys_equal t1 t2 implies eq t1 t2, but not the converse.

Sourceval is_in_subtype : Ecaml_value.Value.t -> bool
Sourceval of_value_exn : Ecaml_value__.Value0.t -> t
Sourceval to_value : t -> Ecaml_value__.Value0.t

Accessors

Sourceval buffer : t -> Buffer.t option

(describe-function 'process-buffer)

Sourceval command : t -> string list option

(describe-function 'process-command)

Sourceval name : t -> string

(describe-function 'process-name)

Sourceval pid : t -> Core.Pid.t option

(describe-function 'process-id)

Sourceval query_on_exit : t -> bool

(describe-function 'process-query-on-exit-flag)

Sourcemodule Status : sig ... end
Sourceval status : t -> Status.t

(describe-function 'process-status)

Sourcemodule Exit_status : sig ... end
Sourceval exit_status : t -> Exit_status.t

(describe-function 'process-exit-status)

Sourcemodule Exited : sig ... end
Sourceval exited : t -> Exited.t Async_kernel.Deferred.t
Sourceval is_alive : t -> bool

(describe-function 'process-live-p)

Sourceval mark : t -> Marker.t

(describe-function 'process-mark)

Sourceval set_query_on_exit : t -> bool -> unit

set_query_on_exit t specifies whether Emacs should query the user about killing t when it exits. (describe-function 'set-process-query-on-exit-flag).

Sourceval all_emacs_children : unit -> t list

(describe-function 'process-list)

Sourceval get_property : t -> Symbol.t -> Ecaml_value.Value.t option

(describe-function 'process-get)

Sourceval set_property : t -> Symbol.t -> Ecaml_value.Value.t -> unit

(describe-function 'process-put)

Sourceval create : ?buffer:Buffer.t -> ?coding:Symbol.t -> ?query_before_exit:bool -> ?stderr:Buffer.t -> string -> string list -> name:string -> unit -> t

(Info-goto-node "(elisp)Asynchronous Processes") (describe-function 'start-process)

Sourceval find_by_name : string -> t option

(describe-function 'get-process) (Info-goto-node "(elisp)Process Information")

Sourcemodule Call : sig ... end
Sourceval call_result_exn : ?input:Call.Input.t -> ?output:Call.Output.t -> ?redisplay_on_output:bool -> ?working_directory:Working_directory.t -> string -> string list -> Call.Result.t

(Info-goto-node "(elisp)Synchronous Processes") (describe-function 'call-process)

Sourceval call_region_exn : ?input:Call.Region_input.t -> ?output:Call.Output.t -> ?redisplay_on_output:bool -> ?working_directory:Working_directory.t -> string -> string list -> Call.Result.t

(Info-goto-node "(elisp)Synchronous Processes") (describe-function 'call-process-region)

Sourceval call_exn : ?input:Call.Input.t -> ?working_directory:Working_directory.t -> ?strip_whitespace:bool -> ?verbose_exn:bool -> ?stderr:[ `Drop_if_ok | `Mix | `Split of Call.Output.Stderr.t ] -> string -> string list -> string

call_exn runs call_result_exn, strips whitespace from stdout+stderr if strip_whitespace is true, and returns the resulting string, raising on nonzero exit.

Sourceval call_expect_no_output_exn : ?input:Call.Input.t -> ?working_directory:Working_directory.t -> ?strip_whitespace:bool -> ?verbose_exn:bool -> string -> string list -> unit

call_expect_no_output_exn runs call_result_exn and raises if the command output is not the empty string or on nonzero exit.

Sourceval shell_command_result : ?input:Call.Input.t -> ?output:Call.Output.t -> ?redisplay_on_output:bool -> ?working_directory:Working_directory.t -> string -> Call.Result.t
Sourceval shell_command_exn : ?input:Call.Input.t -> ?working_directory:Working_directory.t -> ?verbose_exn:bool -> string -> string

shell_command_exn command runs command in a subshell, strips whitespace from stdout+stderr, and returns the resulting string, raising on nonzero exit.

Sourceval shell_command_expect_no_output_exn : ?input:Call.Input.t -> ?working_directory:Working_directory.t -> ?verbose_exn:bool -> string -> unit
Sourceval create_unix_network_process : unit -> filter:(t -> Text.t -> unit) -> name:string -> socket_path:string -> t

(Info-goto-node "(elisp)Network Servers") (describe-function 'make-network-process)

The t returned by create_unix_network_process represents listening on the socket. The t passed to filter represents a specific connection accepted on the socket.

Sourceval kill : t -> unit

(Info-goto-node "(elisp)Deleting Processes") (describe-function 'delete-process).

Sourceval extend_sentinel : Core.Source_code_position.t -> t -> (unit, 'a) Defun.Returns.t -> sentinel:(event:string -> 'a) -> unit

(Info-goto-node "(elisp)Sentinels")

Register sentinel as a process sentinel for the specified process. sentinel runs after any other processes sentinels set for that process.

Sourceval set_sentinel : Core.Source_code_position.t -> t -> (unit, 'a) Defun.Returns.t -> sentinel:(event:string -> 'a) -> unit

Prefer extend_sentinel, which doesn't clobber existing sentinels. (describe-function 'set-process-sentinel)

OCaml

Innovation. Community. Security.