123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106(** A buffer-local is a variable that can have a different value associated with each
buffer.
[Buffer_local] is like [Var], with the additional guarantee that the variable is
buffer local.
Where a module defines a type [t] and a value of type [t Buffer_local.t], the
conventional name for that value is [in_buffer].
[(Info-goto-node "(elisp)Buffer-Local Variables")]. *)open!Coreopen!ImportmoduletypeDefvar_embedded_arg=sigtypet[@@derivingsexp_of]endmoduletypeBuffer_local=sigtype'at[@@derivingsexp_of]valsymbol:_t->Symbol.tvalvar:'at->'aVar.t(** [defvar] defines a buffer-local variable using [Defvar.defvar], and calls
[Var.make_buffer_local_always]. *)valdefvar:Symbol.t->Source_code_position.t->?docstring:string->type_:'aValue.Type.t->default_value:'a->unit->'at(** [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]. *)valwrap_existing:?make_buffer_local_always:bool(** default is [false] *)->Symbol.t->'aValue.Type.t->'at(** Idiomatic usage of [Wrap] looks like:
{[ Buffer_local.Wrap.(SYMBOL_NAME <: TYPE) ]}
For example:
{[ Buffer_local.Wrap.("default-directory" <: string) ]}
To use [~make_buffer_local_always:true], the idiom is:
{[
Buffer_local.Wrap.(
let ( <: ) = ( <: ) ~make_buffer_local_always:true in
SYMBOL_NAME <: TYPE)
]} *)moduleWrap:sigval(<:):?make_buffer_local_always:bool(** default is [false] *)->string->'aValue.Type.t->'atincludeValue.Type.Send(** [defvar_embedded] defines a buffer-local variable whose Elisp representation is an
opaque pointer to an OCaml value, via [Caml_embed.create_type]. This allows one to
store an arbitrary OCaml value in a buffer local, without any conversions between
OCaml and Elisp. *)valdefvar_embedded:Symbol.t->Source_code_position.t->?docstring:string->(moduleDefvar_embedded_argwithtypet='a)->'aoptiontvalget:'at->Buffer.t->'avalget_exn:'aoptiont->Buffer.t->'avalset:'at->'a->Buffer.t->unitvalupdate_exn:'aoptiont->Buffer.t->f:('a->'a)->unit(** A permanent buffer-local variable is unaffected by [kill-all-local-variables], and
so it is not cleared by changing major modes.
See [(Info-goto-node "(elisp)Creating Buffer-Local")]. *)valset_permanent:_t->bool->unitvalis_permanent:_t->boolmodulePrivate:sigvalget_in_current_buffer:'at->'avalget_in_current_buffer_exn:'aoptiont->'avalset_in_current_buffer:'at->'a->unitvalset_temporarily_in_current_buffer:(_,'a)Sync_or_async.t->'bt->'b->f:(unit->'a)->'aendend