Module Ecaml__.Hook.Function

type 'a t
include sig ... end
val sexp_of_t : ('a ‑> Base.Sexp.t) ‑> 'a t ‑> Base.Sexp.t
val create : ?⁠docstring:string ‑> Core_kernel.Source_code_position.t ‑> 'a Type.t ‑> Ecaml.Symbol.t ‑> 'a ‑> 'a t

create here return_type symbol f defines an emacs function named symbol that runs f when called. It returns an 'a t usable for modifying hooks.

val create_with_self : ?⁠docstring:string ‑> Core_kernel.Source_code_position.t ‑> 'a Type.t ‑> Ecaml.Symbol.t ‑> ('a t ‑> 'a) ‑> 'a t

create_with_self here return_type symbol f works the same as create, except that the 'a t it returns is also passed as an argument to f.

This is useful, for example, if f wants to remove itself from a hook once it is called.