Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file value_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404(** [Value.t] is the OCaml type corresponding to Emacs's universal type of values. It is
represented as an OCaml custom block ([emacs_value_ops] in [ecaml_stubs.c]) wrapped
around the [emacs_value] pointer type defined by the Emacs native-code module
interface, [emacs-module.h], available in Emacs 25 and beyond. This module has
low-level functions for working with Emacs values, OCaml wrappers that call the C
functions specified in [emacs-module.h]. All other calls from OCaml to Emacs are
built on top of this module. *)open!Core_kernelopen!Importopen!Async_kernelmoduletypeMake_subtype_arg=sigtypevaluevalhere:Source_code_position.tvalname:stringvalis_in_subtype:value->boolendtype'afuncall=?should_profile:bool->'amoduletypeFuncall=sigtypettypevaluevalfuncall0:(t->value)funcallvalfuncall1:(t->value->value)funcallvalfuncall2:(t->value->value->value)funcallvalfuncall3:(t->value->value->value->value)funcallvalfuncall4:(t->value->value->value->value->value)funcallvalfuncall5:(t->value->value->value->value->value->value)funcallvalfuncallN:(t->valuelist->value)funcallvalfuncallN_array:(t->valuearray->value)funcallvalfuncall0_i:(t->unit)funcallvalfuncall1_i:(t->value->unit)funcallvalfuncall2_i:(t->value->value->unit)funcallvalfuncall3_i:(t->value->value->value->unit)funcallvalfuncall4_i:(t->value->value->value->value->unit)funcallvalfuncall5_i:(t->value->value->value->value->value->unit)funcallvalfuncallN_i:(t->valuelist->unit)funcallvalfuncallN_array_i:(t->valuearray->unit)funcallvalfuncall_int_int_value_value_unit:(t->int->int->value->value->unit)funcallvalfuncall_int_int_value_unit:(t->int->int->value->unit)funcallendmoduletypeSubtype=sigtypevalue(** 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]. *)typet=privatevalue[@@derivingsexp_of](** [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. *)valeq:t->t->boolvalis_in_subtype:value->boolincludeValueable0.Swithtypet:=tendmoduletypeType=sigtypevaluetype'atvalcreate:Sexp.t->('a->Sexp.t)->(value->'a)->('a->value)->'atvalwith_of_value_exn:'at->(value->'a)->'atvalto_sexp:'at->'a->Sexp.tvalbool:booltvalfloat:floattvalignored:unittvalint:inttvalstring:stringt(** [string_cached] is like [string], except it uses [of_utf8_bytes_cached]. *)valstring_cached:stringtvalunit:unittvalvalue:valuetvallist:'at->'alisttvalvector:'at->'aarrayt(** Represent an ocaml array as an elisp list, without creating an intermediate ocaml
list. *)valarray_as_list:'at->'aarrayt(** [option] represents [None] as [nil] and [Some a] as [cons v nil], where [v] is the
representation of [a]. *)valoption:'at->'aoptiont(** [nil_or t_] represents [None] as [nil] and [Some a] as [v], where [v] is the
representation of [a]. This is a common representation used by Elisp functions.
But it is only correct if [nil] is not a representation of any value in [t]; in that
situation use [Type.option_]. *)valnil_or:'at->'aoptiontvalalist:'at->'bt->('a*'b)listt(** Represent a tuple (a,b) as the elisp cons cell (a . b) *)valtuple:'at->'bt->('a*'b)t(** Represent a tuple (a,b) as the elisp list '(a b) *)valtuple2_as_list:'at->'bt->('a*'b)t(** Embed a sexpable ocaml type, so we can save values of the type in emacs, e.g. as
buffer local variables *)valsexpable:(moduleSexpablewithtypet='a)->name:Sexp.t->'at(** A list of directories. Each element is a string (directory name) or nil (try
default directory). nil values are converted to ".", which has the same meaning. *)valpath_list:stringlisttendmoduletypeEnum=sigtypet[@@derivingenumerate,sexp_of]endmoduletypeValue=sigtypet=Value0.t[@@derivingsexp_of]includeFuncallwithtypet:=twithtypevalue:=tvalintern:string->tvalnil:tvalt:tvallist:tlist->t(** [(describe-function 'cons)] *)valcons:t->t->t(** [(describe-function 'car)] *)valcar_exn:t->t(** [(describe-function 'cdr)] *)valcdr_exn:t->tvalto_list_exn:t->f:(t->'a)->'alistvalvector:tarray->tvalto_array_exn:t->f:(t->'a)->'aarrayvaltype_of:t->t(** Convert an elisp list to an ocaml array *)vallist_to_array_exn:t->f:(t->'a)->'aarray(** - [(Info-goto-node "(elisp)Type Predicates")] *)(** [(describe-function 'arrayp)] *)valis_array:t->bool(** [(describe-function 'bufferp)] *)valis_buffer:t->bool(** [(describe-function 'commandp)] *)valis_command:t->bool(** [(describe-function 'eventp)] *)valis_event:t->bool(** [(describe-function 'floatp)] *)valis_float:t->bool(** [(describe-function 'fontp)] *)valis_font:t->bool(** [(describe-function 'framep)] *)valis_frame:t->bool(** [(describe-function 'functionp)] *)valis_function:t->bool(** [(describe-function 'hash-table-p)] *)valis_hash_table:t->bool(** [(describe-function 'integerp)] *)valis_integer:t->bool(** [(describe-function 'keymapp)] *)valis_keymap:t->bool(** [(describe-function 'markerp)] *)valis_marker:t->bool(** [eq t nil] *)valis_nil:t->bool(** [(describe-function 'is-not-nil)] *)valis_not_nil:t->bool(** [(describe-function 'processp)] *)valis_process:t->bool(** [(describe-function 'stringp)] *)valis_string:t->bool(** [(describe-function 'symbolp)] *)valis_symbol:t->bool(** [(describe-function 'syntax-table-p)] *)valis_syntax_table:t->bool(** [(describe-function 'timerp)] *)valis_timer:t->bool(** [(describe-function 'vectorp)] *)valis_vector:t->bool(** [(describe-function 'windowp)] *)valis_window:t->bool(** [(describe-function 'window-configuration-p)] *)valis_window_configuration:t->bool(** [(describe-function 'consp)]
If supplied, [?car] and [?cdr] are additionally required to return true for the car
and cdr, respectively. *)valis_cons:?car:(t->bool)(** default: const true *)->?cdr:(t->bool)(** default: const true *)->t->boolvaleq:t->t->bool(** [(describe-function 'equal)] *)valequal:t->t->boolvalof_bool:bool->t(** [is_not_nil] *)valto_bool:t->bool(** [(describe-variable 'most-negative-fixnum)] *)valemacs_min_int:int(** [(describe-variable 'most-positive-fixnum)] *)valemacs_max_int:int(** [of_int_exn n] raises if [n] is not in the range [emacs_min_int, emacs_max_int] *)valof_int_exn:int->tvalto_int_exn:t->intvalof_float:float->tvalto_float_exn:t->floatvalof_utf8_bytes:string->t(** [of_utf8_bytes_cached] is like [of_utf8_bytes], except it keeps a hash table mapping
each OCaml string to the corresponding Elisp string. This can be used to optimize
the conversion of OCaml values to Elisp values. *)valof_utf8_bytes_cached:string->tvalto_utf8_bytes_exn:t->stringvalvec_get:t->int->tvalvec_set:t->int->t->unitvalvec_size:t->intvalinitialize_module:unitvalmessage:string->unitvalmessagef:('a,unit,string,unit)format4->'avalmessage_s:Sexp.t->unitvalprin1_to_string:t->string(** An ['a Type.t] is an isomorphism between ['a] and a subset of [Value.t]. *)moduleType:sigtypevaluetype'at[@@derivingsexp_of]moduletypeS=Typewithtypevalue:=valuewithtype'at:='atincludeSvalid:'at->'aType_equal.Id.tvalto_value:'at->'a->valuevalof_value_exn:'at->value->'avalname:_t->Sexp.tvalmap:'at->name:Sexp.t->of_:('a->'b)->to_:('b->'a)->'bt(** [map_id type_ name] is short for [map type_ ~name ~of_:Fn.id ~to_:Fn.id].
It is not interchangeable with [type_] itself. *)valmap_id:'at->Sexp.t->'atmoduletypeEnum=Enumvalenum:Sexp.t->(moduleEnumwithtypet='a)->('a->value)->'atendwithtypevalue:=tmoduletypeFuncall=Funcallwithtypevalue:=tmoduletypeMake_subtype_arg=Make_subtype_argwithtypevalue:=tmoduletypeSubtype=Subtypewithtypevalue:=twithtype'atype_:='aType.tmoduleMake_subtype(Subtype:Make_subtype_arg):SubtypemoduleExpert:sigvalhave_active_env:unit->boolvalraise_if_emacs_signaled:unit->unitvalnon_local_exit_signal:exn->unitendmoduleStat:sigtypet={emacs_free_performed:int;emacs_free_scheduled:int}[@@derivingsexp_of]valnow:unit->tvaldiff:t->t->tendmoduleFor_testing:sigvalall_interned_symbols:unit->stringlistexceptionElisp_signalof{symbol:t;data:t}exceptionElisp_throwof{tag:t;value:t}(** Used to edit non-deterministic stuff out of Elisp signals. *)valmap_elisp_signal:(unit->'a)->f:(symbol:t->data:t->reraise:(symbol:t->data:t->Nothing.t)->Nothing.t)->'avalmap_elisp_signal_omit_data:(unit->'a)->'aendmodulePrivate:sigvalecaml_profile_print_length:intoptionrefvalecaml_profile_print_level:intoptionref(** These functions are defined in Async_ecaml. This module exists to avoid
dependency cycles. *)moduleBlock_on_async:sigtypet={f:'a.Source_code_position.t->?context:Sexp.tLazy.t->(unit->'aDeferred.t)->'a}valset_once:tSet_once.tendmoduleEnqueue_foreground_block_on_async:sigtypet={f:Source_code_position.t->?context:Sexp.tLazy.t->?raise_exceptions_to_monitor:Monitor.t->(unit->unitDeferred.t)->unit}valset_once:tSet_once.tendmoduleRun_outside_async:sigtypet={f:'a.Source_code_position.t->?allowed_in_background:bool->(unit->'a)->'aDeferred.t}valset_once:tSet_once.tendvalblock_on_async:Source_code_position.t->?context:Sexp.tLazy.t->(unit->'aDeferred.t)->'avalenqueue_foreground_block_on_async:Source_code_position.t->?context:Sexp.tLazy.t->?raise_exceptions_to_monitor:Monitor.t->(unit->unitDeferred.t)->unitvalrun_outside_async:Source_code_position.t->?allowed_in_background:bool->(unit->'a)->'aDeferred.tvalmessage_zero_alloc:t->unit(** [message_t t] is equivalent to the elisp expression [(message "%s" t)]. *)valmessage_t:t->unitendend