package ecaml

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

Module Ecaml.Current_bufferSource

There are, in general, many buffers in an Emacs session. At any time, one of them is designated as the "current buffer". This is the buffer in which most editing takes place, because most of the primitives for examining or changing text in a buffer operate implicitly on the current buffer. Normally the buffer that is displayed on the screen in the selected window is the current buffer, but this is not always so: a program can temporarily designate any buffer as current in order to operate on its contents, without changing what is displayed on the screen.

(Info-goto-node "(elisp)Current Buffer").

Sourceval get : unit -> Ecaml_value__.Value0.t

(describe-function 'current-buffer)

Sourceval set : Ecaml_value__.Value0.t -> unit

(describe-function 'set-buffer)

Sourceval set_temporarily : (_, 'a) Sync_or_async.t -> Ecaml_value__.Value0.t -> f:(unit -> 'a) -> 'a

set_temporarily t ~f runs f with the current buffer set to t. (describe-function 'with-current-buffer).

Sourceval variable_is_defined : Symbol.t -> bool

(describe-function 'boundp)

variable_is_defined can be locally false in a buffer but true for that symbol globally, so it is defined in Current_buffer.

Sourceval symbol_value : Symbol.t -> Ecaml_value.Value.t

(describe-function 'symbol-value)

Sourceval value : 'a Var.t -> 'a option

(describe-function 'symbol-value)

Sourceval value_exn : 'a Var.t -> 'a

(describe-function 'symbol-value)

Sourceval value_opt_exn : 'a option Var.t -> 'a

value_opt_exn is like value_exn, except that it raises if the variable is defined but None. This is useful for buffer-local variables of type 'a option, with a default value of nil.

Sourceval set_value : 'a Var.t -> 'a -> unit

(describe-function 'set)

Sourceval set_values : Var.And_value.t list -> unit
Sourceval clear_value : 'a Var.t -> unit

(describe-function 'makunbound)

Sourceval set_value_temporarily : (_, 'b) Sync_or_async.t -> 'a Var.t -> 'a -> f:(unit -> 'b) -> 'b
Sourceval set_values_temporarily : (_, 'a) Sync_or_async.t -> Var.And_value.t list -> f:(unit -> 'a) -> 'a
Sourceval has_non_null_value : _ Var.t -> bool

(describe-function 'bound-and-true-p)

Sourceval get_buffer_local : 'a Buffer_local.t -> 'a
Sourceval get_buffer_local_exn : 'a option Buffer_local.t -> 'a
Sourceval set_buffer_local : 'a Buffer_local.t -> 'a -> unit
Sourceval set_buffer_local_temporarily : (_, 'a) Sync_or_async.t -> 'b Buffer_local.t -> 'b -> f:(unit -> 'a) -> 'a
Sourceval directory : Filename.t option Buffer_local.t

(describe-variable 'default-directory) (Info-goto-node "(elisp)File Name Expansion")

Sourceval undo_list : unit -> Ecaml_value.Value.t

(describe-variable 'buffer-undo-list) (Info-goto-node "(elisp)Undo") (Info-goto-node "(elisp)Maintaining Undo")

Sourceval is_undo_enabled : unit -> bool
Sourceval set_undo_enabled : bool -> unit
Sourceval file_name : unit -> string option

(describe-function 'buffer-file-name) (Info-goto-node "(elisp)Buffer File Name")

Sourceval file_name_exn : unit -> string
Sourceval name : unit -> string

(describe-function 'buffer-name)

Sourceval file_name_var : Filename.t option Buffer_local.t

(describe-variable 'buffer-file-name) (Info-goto-node "(elisp)Buffer File Name")

Sourcemodule Coding_system : sig ... end
Sourceval file_coding_system : Coding_system.t option Buffer_local.t

(describe-variable 'file-coding-system)

Sourceval add_undo_boundary : unit -> unit

(describe-function 'undo-boundary) (Info-goto-node "(elisp)Undo")

Sourceval undo : int -> unit

(describe-function 'undo)

Sourceval set_temporarily_to_temp_buffer : ?name:string -> (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a

set_temporarily_to_temp_buffer f creates a temporary buffer and runs f with the current buffer set to the temporary buffer. (describe-function 'with-temp-buffer).

Sourceval bury : unit -> unit

(describe-function 'bury-buffer) (Info-goto-node "(elisp)Buffer List")

Sourceval is_modified : unit -> bool

(describe-function 'buffer-modified-p)

Sourceval set_modified : bool -> unit

(describe-function 'set-buffer-modified-p)

Sourceval fill_column : int Buffer_local.t

(describe-variable 'fill-column) (Info-goto-node "(elisp)Margins")

Sourceval paragraph_start : Regexp.t Var.t

(describe-variable 'paragraph-start) (Info-goto-node "(elisp)Standard Regexps ")

Sourceval paragraph_separate : Regexp.t Var.t

(describe-variable 'paragraph-separate) (Info-goto-node "(elisp)Standard Regexps ")

Sourceval read_only : bool Buffer_local.t

(describe-variable 'buffer-read-only) (Info-goto-node "(elisp)Read-Only Buffers")

Sourceval transient_mark_mode : bool Customization.t

(describe-variable 'transient-mark-mode) (describe-function 'transient-mark-mode) (Info-goto-node "(elisp)The Mark")

Sourceval major_mode : unit -> Major_mode.t

(describe-variable 'major-mode) (Info-goto-node "(elisp)Auto Major Mode")

Sourceval change_major_mode : Major_mode.t -> unit Async_kernel.Deferred.t
Sourceval set_auto_mode : ?keep_mode_if_same:bool -> unit -> unit Async_kernel.Deferred.t

(describe-function 'set-auto-mode)

Sourceval make_buffer_local : _ Var.t -> unit

(describe-function 'make-local-variable) (Info-goto-node "(elisp)Creating Buffer-Local")

Sourceval is_buffer_local : _ Var.t -> bool

(describe-function 'local-variable-p) (Info-goto-node "(elisp)Creating Buffer-Local")

Sourceval is_buffer_local_if_set : _ Var.t -> bool

(describe-function 'local-variable-if-set-p) (Info-goto-node "(elisp)Creating Buffer-Local")

Sourceval buffer_local_variables : unit -> (Symbol.t * Ecaml_value.Value.t option) list

(describe-function 'buffer-local-variables) (Info-goto-node "(elisp)Creating Buffer-Local")

Sourceval kill_buffer_local : _ Var.t -> unit

(describe-function 'kill-local-variable) (Info-goto-node "(elisp)Creating Buffer-Local")

Sourceval local_keymap : unit -> Keymap.t option

(describe-function 'current-local-map) (Info-goto-node "(elisp)Controlling Active Maps")

Sourceval set_local_keymap : Keymap.t -> unit

(describe-function 'use-local-map) (Info-goto-node "(elisp)Controlling Active Maps")

Sourceval minor_mode_keymaps : unit -> Keymap.t list

(describe-function 'current-minor-mode-maps) (Info-goto-node "(elisp)Controlling Active Maps")

Sourceval contents : ?start:Position.t -> ?end_:Position.t -> ?text_properties:bool -> unit -> Text.t

(describe-function 'buffer-substring) (describe-function 'buffer-substring-no-properties)

Sourceval kill : unit -> unit Async_kernel.Deferred.t

(Info-goto-node "(elisp)Killing Buffers") (describe-function 'kill-buffer)

Sourceval save : unit -> unit Async_kernel.Deferred.t

(Info-goto-node "(elisp)Saving Buffers") (describe-function 'save-buffer)

Sourceval erase : unit -> unit

(describe-function 'erase-buffer)

Sourceval delete_region : start:Position.t -> end_:Position.t -> unit

(describe-function 'delete-region) (Info-goto-node "(elisp)Deletion")

Sourceval kill_region : start:Position.t -> end_:Position.t -> unit

(describe-function 'kill-region)

Sourceval widen : unit -> unit

(describe-function 'widen) (Info-goto-node "(elisp)Narrowing")

Sourceval save_current_buffer : (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a

(describe-function 'save-current-buffer)

Sourceval save_excursion : (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a

(describe-function 'save-excursion)

Sourceval save_mark_and_excursion : (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a

(describe-function 'save-mark-and-excursion)

Sourceval save_restriction : (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a

(describe-function 'save-restriction)

Sourceval set_multibyte : bool -> unit

(describe-function 'set-buffer-multibyte). (Info-goto-node "(elisp)Selecting a Representation").

Sourceval is_multibyte : unit -> bool

(describe-variable 'enable-multibyte-characters).

Sourceval rename_exn : ?unique:bool -> unit -> name:string -> unit

rename_exn renames the current buffer, raising if name is already taken and unique = false; with unique = true it generates a new name. (describe-function 'rename-buffer).

Sourceval set_text_property : ?start:Position.t -> ?end_:Position.t -> 'a Text.Property_name.t -> 'a -> unit

(describe-function 'put-text-property) (Info-goto-node "(elisp)Changing Properties").

Sourceval set_text_property_staged : 'a Text.Property_name.t -> 'a -> (start:int -> end_:int -> unit) Core.Staged.t

set_text_property_staged is an optimization of set_text_property for the same text property on a number of regions, where the positions are ints. It precomputes the Elisp property value once, and reuses it for each region.

Sourceval set_text_properties : ?start:Position.t -> ?end_:Position.t -> Text.Property.t list -> unit

(describe-function 'set-text-properties) (Info-goto-node "(elisp)Changing Properties").

Sourceval set_text_properties_staged : Text.Property.t list -> (start:int -> end_:int -> unit) Core.Staged.t

set_text_properties_staged is an optimization of set_text_properties for the same text property on a number of regions, where the positions are ints. It precomputes the Elisp property value once, and reuses it for each region.

Sourceval get_text_property : Position.t -> 'a Text.Property_name.t -> 'a option

(describe-function 'get-text-property)

Sourceval add_text_properties : ?start:Position.t -> ?end_:Position.t -> Text.Property.t list -> unit

(describe-function 'add-text-properties) (Info-goto-node "(elisp)Changing Properties").

Sourceval add_text_properties_staged : Text.Property.t list -> (start:int -> end_:int -> unit) Core.Staged.t

add_text_properties_staged is an optimization of add_text_properties for the same text property on a number of regions, where the positions are ints. It precomputes the Elisp property value once, and reuses it for each region.

Sourceval text_property_is_present : ?start:Position.t -> ?end_:Position.t -> _ Text.Property_name.t -> bool

text_property_is_present property_name returns true if any text in the region from start to end_ uses property_name. (describe-function 'text-property-not-all)

Sourceval set_marker_position : Marker.t -> Position.t -> unit

(describe-function 'set-marker) (Info-goto-node "(elisp)Moving Markers")

Sourceval mark : unit -> Marker.t

(describe-function 'mark-marker) (Info-goto-node "(elisp)The Mark")

Sourceval set_mark : Position.t -> unit

(describe-function 'set-mark) (Info-goto-node "(elisp)The Mark")

Sourceval mark_is_active : unit -> bool

(describe-variable 'mark-active) (Info-goto-node "(elisp)The Mark")

Sourceval active_region : unit -> (Position.t * Position.t) option

(describe-function 'region-beginning) (describe-function 'region-end) (describe-function 'use-region-p)

Returns (region-beginning), (region-end) if the region should be used (according to use-region-p).

Sourceval deactivate_mark : unit -> unit

(describe-function 'deactivate-mark) (Info-goto-node "(elisp)The Mark")

(describe-function 'char-syntax) (Info-goto-node "(elisp)Syntax Table Functions")

Sourceval syntax_table : unit -> Syntax_table.t

(describe-function 'syntax-table) (Info-goto-node "(elisp)Syntax Table Functions")

Sourceval set_syntax_table : Syntax_table.t -> unit

(describe-function 'set-syntax-table) (Info-goto-node "(elisp)Syntax Table Functions")

Sourceval delete_lines_matching : ?start:Position.t -> ?end_:Position.t -> Regexp.t -> unit

(describe-function 'flush-lines)

Sourceval sort_lines : ?start:Position.t -> ?end_:Position.t -> unit -> unit

(describe-function 'sort-lines) (Info-goto-node "(elisp)Sorting")

Sourceval delete_duplicate_lines : ?start:Position.t -> ?end_:Position.t -> unit -> unit

(describe-function 'delete-duplicate-lines)

Sourceval indent_region : ?start:Position.t -> ?end_:Position.t -> unit -> unit

(describe-function 'indent-region) (Info-goto-node "(elisp)Region Indent")

Sourceval revert : ?confirm:bool -> unit -> unit Async_kernel.Deferred.t

(describe-function 'revert-buffer) (Info-goto-node "(elisp)Reverting")

Sourceval set_revert_buffer_function : Core.Source_code_position.t -> (unit, 'a) Defun.Returns.t -> (confirm:bool -> 'a) -> unit

(describe-variable 'revert-buffer-function)

Sourceval replace_buffer_contents : ?max_duration:Core.Time_ns.Span.t -> ?max_costs:int -> Buffer.t -> unit

(describe-function 'replace-buffer-contents)

Sourceval replace_string : ?start:Position.t -> ?end_:Position.t -> from:string -> to_:string -> unit -> unit

replace_string ~from ~to_ replaces all occurrences of from with to_. It is like (describe-function 'replace-string), but doesn't actually call that, because its documentation says:

  This function is for interactive use only;
  in Lisp code use `search-forward' and `replace-match' instead.
Sourceval size : unit -> int

(describe-function 'buffer-size)

Sourceval truncate_lines : bool Buffer_local.t

(describe-variable 'truncate-lines)

Sourceval chars_modified_tick : unit -> Modified_tick.t

(describe-function 'buffer-chars-modified-tick) (Info-goto-node "(elisp)Buffer Modification")

Sourceval append_to : string -> unit

append_to string appends string to the end of the current buffer, and preserves point-at-max for windows that display it.

Sourceval inhibit_read_only : (_, 'a) Sync_or_async.t -> (unit -> 'a) -> 'a
Sourceval line_and_column_of_position : Position.t -> Line_and_column.t
Sourceval position_of_line_and_column : Line_and_column.t -> Position.t

(describe-function 'key-binding)