package ecaml

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

Module Ecaml.PointSource

"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").

Sourceval get : unit -> Position.t

(describe-function 'point).

Sourceval get_line_and_column : unit -> Line_and_column.t
Sourceval min : unit -> Position.t

(describe-function 'point-min).

Sourceval max : unit -> Position.t

(describe-function 'point-max).

Sourceval goto_char : Position.t -> unit

(describe-function 'goto-char).

Sourceval goto_line_and_column : Line_and_column.t -> unit
Sourceval goto_max : unit -> unit

goto_max () = goto_char (max ())

Sourceval goto_min : unit -> unit

goto_min () = goto_char (min ())

Sourceval beginning_of_line : unit -> unit

(describe-function 'beginning-of-line).

Sourceval beginning_of_line_position : unit -> Position.t

(describe-function 'line-beginning-position)

Sourceval end_of_line : unit -> unit

(describe-function 'end-of-line).

Sourceval end_of_line_position : unit -> Position.t

(describe-function 'line-end-position)

Sourceval count_lines : start:Position.t -> end_:Position.t -> int

(describe-function 'count-lines).

Sourceval goto_first_non_blank : unit -> unit

(describe-function 'back-to-indentation).

Sourceval forward_char_exn : int -> unit

forward_char_exn n moves point n characters forward (backward if n is negative). forward_char_exn raises on reaching end or beginning of buffer. (describe-function 'forward-char).

Sourceval backward_char_exn : int -> unit

backward_char_exn n = forward_char_exn (- n).

Sourceval delete_forward_char_exn : int -> unit

(describe-function 'delete-char).

Sourceval delete_backward_char_exn : int -> unit

delete_backward_char_exn n = delete_forward_char_exn (- n).

Sourceval forward_line : int -> unit

forward_line n moves n lines forward (backward if n is negative). Precisely, if point is on line i, move to the start of line i + 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")

Sourceval forward_line_exn : int -> unit

forward_line_exn n is like forward_line n, but it raises if it could not move the full n lines.

Sourceval backward_line : int -> unit

backward_line n = forward_line (- n).

Sourceval forward_sexp_exn : int -> unit

(describe-function 'forward-sexp) (Info-goto-node "(elisp)List Motion")

Sourceval backward_sexp_exn : int -> unit

(describe-function 'backward-sexp) (Info-goto-node "(elisp)List Motion")

Sourceval forward_word : int -> unit

(describe-function 'forward-word) (Info-goto-node "(elisp)Word Motion")

Sourceval backward_word : int -> unit

(describe-function 'backward-word) (Info-goto-node "(elisp)Word Motion")

Sourceval following_char : unit -> Char_code.t

(describe-function 'following-char)

Sourceval line_number : unit -> int

line_number returns the line number of the character after point, where the first line of the buffer is line 1. (describe-function 'line-number-at-pos). (Info-goto-node "(elisp)Text Lines")

Sourceval is_beginning_of_buffer : unit -> bool

(describe-function 'bobp)

Sourceval is_end_of_buffer : unit -> bool

(describe-function 'eobp)

Sourceval 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")

Sourceval goto_column : int -> unit

goto_column c moves point to column c on the current line. (describe-function 'move-to-column). (Info-goto-node "(elisp)Columns")

Sourceval goto_line : int -> unit

goto_line l = goto_min (); forward_line (l - 1)

Sourceval indent_line_to : column:int -> unit

(describe-function 'indent-line-to)

Sourceval insert : string -> unit

(describe-function 'insert)

Sourceval insert_text : Text.t -> unit
Sourceval insert_file_contents_exn : ?replace:bool -> string -> unit

(describe-function 'insert-file-contents)

Sourceval insert_file_contents_literally : ?replace:bool -> string -> unit

(describe-function 'insert-file-contents-literally)

Sourceval kill_word : int -> unit

(describe-function 'kill-word).

(Info-goto-node "(elisp)Creating Markers")

Sourceval marker_at : unit -> Marker.t

(describe-function 'point-marker).

Sourceval marker_at_min : unit -> Marker.t

(describe-function 'point-min-marker).

Sourceval marker_at_max : unit -> Marker.t

(describe-function 'point-max-marker).

Sourceval next_line : unit -> unit

(describe-function 'next-line).

Sourceval previous_line : unit -> unit

(describe-function 'previous-line).

Sourceval scroll_up : int -> unit

There are eight search functions, varying by whether they:

  • search for a string or a regexp
  • search forward or backward from point
  • indicate success/failure by returning a boolean or raising on failure

Searching backward sets point to the start of the match. Searching forward sets point to the end of the match. With ~bound, when searching backward, the match must start before bound; when searching forward, the match must end before bound. With ~update_last_match:true, searching updates Regexp.Last_match.

(Info-goto-node "(elisp)String Search") (describe-function 'search-backward) (describe-function 'search-forward)

(Info-goto-node "(elisp)Regexp Search") (describe-function 'search-backward-regexp) (describe-function 'search-forward-regexp)

type 'a with_search_options := ?bound:Position.t -> ?update_last_match:bool -> 'a
Sourceval search_backward : (string -> bool) with_search_options
Sourceval search_backward_exn : (string -> unit) with_search_options
Sourceval search_forward : (string -> bool) with_search_options
Sourceval search_forward_exn : (string -> unit) with_search_options
Sourceval search_backward_regexp : (Regexp.t -> bool) with_search_options
Sourceval search_backward_regexp_exn : (Regexp.t -> unit) with_search_options
Sourceval search_forward_regexp : (Regexp.t -> bool) with_search_options
Sourceval search_forward_regexp_exn : (Regexp.t -> unit) with_search_options

(describe-variable 'case-fold-search)

Sourceval looking_at : ?update_last_match:bool -> Regexp.t -> bool

looking_at regexp returns true if the text after point matches regexp. (describe-function 'looking-at) (describe-function 'looking-at-p) (Info-goto-node "(elisp)Regexp Search")

Sourceval recenter : ?screen_line:int -> unit -> unit

(describe-function 'recenter)

Sourceval function_called_at : unit -> Symbol.t option

(describe-function 'function-called-at-point)

Sourceval variable_at : unit -> Symbol.t option

(describe-function 'variable-at-point)

Sourceval yank : unit -> unit

(describe-function 'yank)

Search for text properties in the current buffer.

OCaml

Innovation. Community. Security.