Module Ecaml.Point
"Point" is a special buffer position used by many editing commands. Like other positions, point designates a place between two characters (or before the first character, or after the last character), rather than a particular character. The value of point is a number no less than 1, and no greater than the buffer size plus 1.
Each buffer has its own value of point, which is independent of the value of point in other buffers. Each window also has a value of point, which is independent of the value of point in other windows on the same buffer. This is why point can have different values in various windows that display the same buffer. When a buffer appears in only one window, the buffer's point and the window's point normally have the same value, so the distinction is rarely important.
(Info-goto-node "(elisp)Point")
.
val get : unit -> Position.t
(describe-function 'point)
.
val get_line_and_column : unit -> Line_and_column.t
val min : unit -> Position.t
(describe-function 'point-min)
.
val max : unit -> Position.t
(describe-function 'point-max)
.
val goto_char : Position.t -> unit
(describe-function 'goto-char)
.
val goto_line_and_column : Line_and_column.t -> unit
val goto_max : unit -> unit
goto_max () = goto_char (max ())
val count_lines : start:Position.t -> end_:Position.t -> int
(describe-function 'count-lines)
.
val forward_char_exn : int -> unit
forward_char_exn n
moves pointn
characters forward (backward ifn
is negative).forward_char_exn
raises on reaching end or beginning of buffer.(describe-function 'forward-char)
.
val delete_backward_char_exn : int -> unit
delete_backward_char_exn n = delete_forward_char_exn (- n)
.
val forward_line : int -> unit
forward_line n
movesn
lines forward (backward ifn
is negative). Precisely, if point is on linei
, move to the start of linei + n
("start of line" in the logical order). If there isn’t room, go as far as possible (no error).(describe-function 'forward-line)
.(Info-goto-node "(elisp)Text Lines")
val forward_line_exn : int -> unit
forward_line_exn n
is likeforward_line n
, but it raises if it could not move the fulln
lines.
val forward_sexp_exn : int -> unit
(describe-function 'forward-sexp)
(Info-goto-node "(elisp)List Motion")
val backward_sexp_exn : int -> unit
(describe-function 'backward-sexp)
(Info-goto-node "(elisp)List Motion")
val forward_word : int -> unit
(describe-function 'forward-word)
(Info-goto-node "(elisp)Word Motion")
val backward_word : int -> unit
(describe-function 'backward-word)
(Info-goto-node "(elisp)Word Motion")
val following_char : unit -> Char_code.t
(describe-function 'following-char)
val line_number : unit -> int
line_number
returns the line number of the character after point, where the first line of the buffer is line1
.(describe-function 'line-number-at-pos)
.(Info-goto-node "(elisp)Text Lines")
val column_number : unit -> int
column_number
returns the colum of point, where the beginning of line is column 0.(describe-function 'current-column)
.(Info-goto-node "(elisp)Columns")
val goto_column : int -> unit
goto_column c
moves point to columnc
on the current line.(describe-function 'move-to-column)
.(Info-goto-node "(elisp)Columns")
val insert_text : Text.t -> unit
val insert_file_contents_exn : ?replace:bool -> string -> unit
(describe-function 'insert-file-contents)
val insert_file_contents_literally : ?replace:bool -> string -> unit
(describe-function 'insert-file-contents-literally)
val marker_at : unit -> Marker.t
(describe-function 'point-marker)
.
val marker_at_min : unit -> Marker.t
(describe-function 'point-min-marker)
.
val marker_at_max : unit -> Marker.t
(describe-function 'point-max-marker)
.
type 'a with_search_options
:= ?bound:Position.t -> ?update_last_match:bool -> 'a
val search_backward : (string -> bool) with_search_options
val search_backward_exn : (string -> unit) with_search_options
val search_forward : (string -> bool) with_search_options
val search_forward_exn : (string -> unit) with_search_options
val search_backward_regexp : (Regexp.t -> bool) with_search_options
val search_backward_regexp_exn : (Regexp.t -> unit) with_search_options
val search_forward_regexp : (Regexp.t -> bool) with_search_options
val search_forward_regexp_exn : (Regexp.t -> unit) with_search_options
val case_fold_search : bool Buffer_local.t
(describe-variable 'case-fold-search)
val looking_at : ?update_last_match:bool -> Regexp.t -> bool
looking_at regexp
returnstrue
if the text after point matchesregexp
.(describe-function 'looking-at)
(describe-function 'looking-at-p)
(Info-goto-node "(elisp)Regexp Search")
val function_called_at : unit -> Symbol.t option
(describe-function 'function-called-at-point)
val variable_at : unit -> Symbol.t option
(describe-function 'variable-at-point)