Module Ecaml__.Buffer_local

type 'a t
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
val symbol : _ t -> Ecaml.Symbol.t
val var : 'a t -> 'a Ecaml.Var.t
val defvar : Ecaml.Symbol.t -> Core.Source_code_position.t -> ?⁠docstring:string -> type_:'a Ecaml__.Import.Value.Type.t -> default_value:'a -> unit -> 'a t

defvar defines a buffer-local variable using Defvar.defvar, and calls Var.make_buffer_local_always.

val wrap_existing : ?⁠make_buffer_local_always:bool -> Ecaml.Symbol.t -> 'a Ecaml__.Import.Value.Type.t -> 'a t

wrap_existing var takes a variable defined in Elisp and makes it available as a Buffer_local.t. If make_buffer_local_always = false, then wrap_existing raises if Var.is_buffer_local_always var = false. If make_buffer_local_always = true, then wrap_existing calls Var.make_buffer_local_always var.

val defvar_embedded : Ecaml.Symbol.t -> Core.Source_code_position.t -> ?⁠docstring:string -> (module Ecaml__.Buffer_local_intf.Defvar_embedded_arg with type t = 'a) -> 'a option t

defvar_embedded defines a buffer-local variable whose Elisp representation is an opaque pointer to an OCaml value, via Value.Type.caml_embed. This allows one to store an arbitrary OCaml value in a buffer local, without any conversions between OCaml and Elisp.

val get : 'a t -> Ecaml__.Import.Buffer.t -> 'a
val get_exn : 'a option t -> Ecaml__.Import.Buffer.t -> 'a
val set : 'a t -> 'a -> Ecaml__.Import.Buffer.t -> unit
module Private : sig ... end