Module Ecaml.Buffer

Buffers are used to hold the contents of files that are being visited; there may also be buffers that are not visiting files.

include Value.Subtype with type t = Ecaml__.Buffer0.t
type value
type 'a type_

We expose private value for free identity conversions when the value is nested in some covariant type, e.g. (symbols : Symbol.t list :> Value.t list) rather than List.map symbols ~f:Symbol.to_value.

include sig ... end
val sexp_of_t : t ‑> Sexplib.Sexp.t
val of_value_exn : value ‑> t
val to_value : t ‑> value
val 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.

val type_ : t type_
type buffer = t
include Core_kernel.Equal.S with type t := t
type t
val file_name : t ‑> string option

Accessors

- (describe-function 'buffer-file-name)

val is_live : t ‑> bool

- (describe-function 'buffer-file-name)

- (describe-function 'buffer-live-p)

val name : t ‑> string option

- (describe-function 'buffer-live-p)

- (describe-function 'buffer-name)

val process : t ‑> Ecaml__.Process0.t option

- (describe-function 'buffer-name)

- (describe-function 'get-buffer-process)

val all_live : unit ‑> t list

all_live returns a list of all live buffers. (describe-function 'buffer-list).

val create : name:string ‑> t

create ~name creates a new buffer with name name, adjusting the name if necessary to make the buffer's name unique. (describe-function 'generate-new-buffer).

val find : name:string ‑> t option

find ~name returns the live buffer whose name is name, if any. (describe-function 'get-buffer).

val find_or_create : name:string ‑> t

find ~name returns the live buffer whose name is name, and if there is no such buffer, creates it. (describe-function 'get-buffer-create).

val kill : t ‑> unit

kill t kills t, so that not (is_live t). (describe-function 'kill-buffer).

val displayed_in : t ‑> Ecaml__.Window0.t list

(describe-function 'get-buffer-window-list)

val display : t ‑> unit

(Info-goto-node "(elisp)Choosing Window")(describe-function 'display-buffer)

val buffer_local_value : t ‑> 'a Var.t ‑> 'a

(describe-function 'buffer-local-value)(Info-goto-node "(elisp)Creating Buffer-Local")

val buffer_local_variables : t ‑> (Symbol.t * Value.t option) list

(describe-function 'buffer-local-variables)(Info-goto-node "(elisp)Creating Buffer-Local")

val find_file_noselect : Filename.t ‑> t

(describe-function 'find-file-noselect)(Info-goto-node "(elisp)Visiting Functions")

module Which_buffers : sig ... end
val save_some : ?⁠query:bool ‑> ?⁠which_buffers:Which_buffers.t ‑> unit ‑> unit

(describe-function 'save-some-buffers)(Info-goto-node "(elisp)Saving Buffers")