A "position" is the index of a character in the text of a buffer. More precisely, a position identifies the place between two characters (or before the first character, or after the last character), so we can speak of the character before or after a given position. However, we often speak of the character "at" a position, meaning the character after that position.
Positions are usually represented as integers starting from 1, but can also be represented as "markers"--special objects that relocate automatically when text is inserted or deleted so they stay with the surrounding characters.
(Info-goto-node "(elisp)Positions")
.
include Value.Subtype
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
.
include sig ... end
val sexp_of_t : t ‑> Base.Sexp.t
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.
include Ecaml__.Valueable0.S with type t := t
val of_value_exn : Ecaml__.Value0.t ‑> t
val to_value : t ‑> Ecaml__.Value0.t
include Core_kernel.Comparable.S_plain with type t := t
include Core_kernel__.Comparable_intf.S_common
include Base.Comparable.S
include Base__.Comparable_intf.Polymorphic_compare
ascending
is identical to compare
. descending x y = ascending y x
. These are
intended to be mnemonic when used like List.sort ~compare:ascending
and List.sort
~cmp:descending
, since they cause the list to be sorted in ascending or descending
order, respectively.
clamp_exn t ~min ~max
returns t'
, the closest value to t
such that
between t' ~low:min ~high:max
is true.
Raises if not (min <= max)
.
val clamp : t ‑> min:t ‑> max:t ‑> t Base.Or_error.t
include Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparator
include Base__.Comparable_intf.Validate with type t := t
val validate_lbound : min:t Base.Maybe_bound.t ‑> t Base.Validate.check
val validate_ubound : max:t Base.Maybe_bound.t ‑> t Base.Validate.check
val validate_bound : min:t Base.Maybe_bound.t ‑> max:t Base.Maybe_bound.t ‑> t Base.Validate.check
module Replace_polymorphic_compare : Core_kernel__.Comparable_intf.Polymorphic_compare with type t := t
module Map : Core_kernel.Map.S_plain with type Key.t = t with type Key.comparator_witness = comparator_witness
module Set : Core_kernel.Set.S_plain with type Elt.t = t with type Elt.comparator_witness = comparator_witness
val of_int_exn : int ‑> t
val to_int : t ‑> int