package ecaml

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

Module Ecaml.Buffer_localSource

Sourcetype 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
Sourceval symbol : _ t -> Symbol.t
Sourceval var : 'a t -> 'a Var.t
Sourceval defvar : Symbol.t -> Core.Source_code_position.t -> ?docstring:string -> type_:'a Ecaml_value.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.

Sourceval wrap_existing : ?make_buffer_local_always:bool -> Symbol.t -> 'a Ecaml_value.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.

Sourcemodule Wrap : sig ... end

Idiomatic usage of Wrap looks like:

Sourceval defvar_embedded : 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 Caml_embed.create_type. This allows one to store an arbitrary OCaml value in a buffer local, without any conversions between OCaml and Elisp.

Sourceval get : 'a t -> Buffer.t -> 'a
Sourceval get_exn : 'a option t -> Buffer.t -> 'a
Sourceval set : 'a t -> 'a -> Buffer.t -> unit
Sourceval update_exn : 'a option t -> Buffer.t -> f:('a -> 'a) -> unit
Sourceval set_permanent : _ t -> bool -> 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").

Sourceval is_permanent : _ t -> bool
Sourcemodule Private : sig ... end