Module Ecaml__.Current_buffer
include Ecaml__.Current_buffer0_intf.Current_buffer0_public
val get : unit -> Ecaml__.Buffer0.t
(describe-function 'current-buffer)
val set : Ecaml__.Buffer0.t -> unit
(describe-function 'set-buffer)
val set_temporarily : (_, 'a) Ecaml.Sync_or_async.t -> Ecaml__.Buffer0.t -> f:(unit -> 'a) -> 'a
set_temporarily t ~f
runsf
with the current buffer set tot
.(describe-function 'with-current-buffer)
.
val variable_is_defined : Ecaml.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 inCurrent_buffer
.
val symbol_value : Ecaml.Symbol.t -> Ecaml__.Import0.Value.t
(describe-function 'symbol-value)
val value : 'a Ecaml.Var.t -> 'a option
(describe-function 'symbol-value)
val value_exn : 'a Ecaml.Var.t -> 'a
(describe-function 'symbol-value)
val value_opt_exn : 'a option Ecaml.Var.t -> 'a
value_opt_exn
is likevalue_exn
, except that it raises if the variable is defined butNone
. This is useful for buffer-local variables of type'a option
, with a default value of nil.
val set_value : 'a Ecaml.Var.t -> 'a -> unit
(describe-function 'set)
val set_values : Ecaml.Var.And_value.t list -> unit
val clear_value : 'a Ecaml.Var.t -> unit
(describe-function 'makunbound)
val set_value_temporarily : (_, 'b) Ecaml.Sync_or_async.t -> 'a Ecaml.Var.t -> 'a -> f:(unit -> 'b) -> 'b
val set_values_temporarily : (_, 'a) Ecaml.Sync_or_async.t -> Ecaml.Var.And_value.t list -> f:(unit -> 'a) -> 'a
val has_non_null_value : _ Ecaml.Var.t -> bool
(describe-function 'bound-and-true-p)
val get_buffer_local : 'a Ecaml.Buffer_local.t -> 'a
val get_buffer_local_exn : 'a option Ecaml.Buffer_local.t -> 'a
val set_buffer_local : 'a Ecaml.Buffer_local.t -> 'a -> unit
val set_buffer_local_temporarily : (_, 'a) Ecaml.Sync_or_async.t -> 'b Ecaml.Buffer_local.t -> 'b -> f:(unit -> 'a) -> 'a
val directory : Ecaml__.Ecaml_filename.Filename.t option Ecaml.Buffer_local.t
(describe-variable 'default-directory)
(Info-goto-node "(elisp)File Name Expansion")
val undo_list : unit -> Ecaml__.Import.Value.t
(describe-variable 'buffer-undo-list)
(Info-goto-node "(elisp)Undo")
(Info-goto-node "(elisp)Maintaining Undo")
val is_undo_enabled : unit -> bool
val set_undo_enabled : bool -> unit
val file_name : unit -> string option
(describe-function 'buffer-file-name)
(Info-goto-node "(elisp)Buffer File Name")
val file_name_var : Ecaml__.Ecaml_filename.Filename.t option Ecaml.Buffer_local.t
(describe-variable 'buffer-file-name)
(Info-goto-node "(elisp)Buffer File Name")
module Coding_system : sig ... end
val file_coding_system : Coding_system.t option Ecaml.Buffer_local.t
(describe-variable 'file-coding-system)
val add_undo_boundary : unit -> unit
(describe-function 'undo-boundary)
(Info-goto-node "(elisp)Undo")
val describe_mode : unit -> unit
(describe-function 'describe-mode)
(Info-goto-node "(elisp)Mode Help")
val set_temporarily_to_temp_buffer : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
set_temporarily_to_temp_buffer f
creates a temporary buffer and runsf
with the current buffer set to the temporary buffer.(describe-function 'with-temp-buffer)
.
val fill_column : int Ecaml.Buffer_local.t
(describe-variable 'fill-column)
(Info-goto-node "(elisp)Margins")
val paragraph_start : Ecaml.Regexp.t Ecaml.Var.t
(describe-variable 'paragraph-start)
(Info-goto-node "(elisp)Standard Regexps ")
val paragraph_separate : Ecaml.Regexp.t Ecaml.Var.t
(describe-variable 'paragraph-separate)
(Info-goto-node "(elisp)Standard Regexps ")
val read_only : bool Ecaml.Buffer_local.t
(describe-variable 'buffer-read-only)
(Info-goto-node "(elisp)Read-Only Buffers")
val transient_mark_mode : bool Ecaml.Var.t
(describe-variable 'transient-mark-mode)
(describe-function 'transient-mark-mode)
(Info-goto-node "(elisp)The Mark")
val major_mode : unit -> Ecaml.Major_mode.t
(describe-variable 'major-mode)
(Info-goto-node "(elisp)Auto Major Mode")
val change_major_mode : Ecaml.Major_mode.t -> unit Async_kernel.Deferred.t
val set_auto_mode : ?keep_mode_if_same:bool -> unit -> unit Async_kernel.Deferred.t
(describe-function 'set-auto-mode)
val make_buffer_local : _ Ecaml.Var.t -> unit
(describe-function 'make-local-variable)
(Info-goto-node "(elisp)Creating Buffer-Local")
val is_buffer_local : _ Ecaml.Var.t -> bool
(describe-function 'local-variable-p)
(Info-goto-node "(elisp)Creating Buffer-Local")
val is_buffer_local_if_set : _ Ecaml.Var.t -> bool
(describe-function 'local-variable-if-set-p)
(Info-goto-node "(elisp)Creating Buffer-Local")
val buffer_local_variables : unit -> (Ecaml.Symbol.t * Ecaml__.Import.Value.t option) list
(describe-function 'buffer-local-variables)
(Info-goto-node "(elisp)Creating Buffer-Local")
val kill_buffer_local : _ Ecaml.Var.t -> unit
(describe-function 'kill-local-variable)
(Info-goto-node "(elisp)Creating Buffer-Local")
val local_keymap : unit -> Ecaml.Keymap.t option
(describe-function 'current-local-map)
(Info-goto-node "(elisp)Controlling Active Maps")
val set_local_keymap : Ecaml.Keymap.t -> unit
(describe-function 'use-local-map)
(Info-goto-node "(elisp)Controlling Active Maps")
val minor_mode_keymaps : unit -> Ecaml.Keymap.t list
(describe-function 'current-minor-mode-maps)
(Info-goto-node "(elisp)Controlling Active Maps")
val contents : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> ?text_properties:bool -> unit -> Ecaml.Text.t
(describe-function 'buffer-substring)
(describe-function 'buffer-substring-no-properties)
val kill : unit -> unit Async_kernel.Deferred.t
(Info-goto-node "(elisp)Killing Buffers")
(describe-function 'kill-buffer)
val save : unit -> unit Async_kernel.Deferred.t
(Info-goto-node "(elisp)Saving Buffers")
(describe-function 'save-buffer)
val delete_region : start:Ecaml.Position.t -> end_:Ecaml.Position.t -> unit
(describe-function 'delete-region)
(Info-goto-node "(elisp)Deletion")
val kill_region : start:Ecaml.Position.t -> end_:Ecaml.Position.t -> unit
(describe-function 'kill-region)
val save_current_buffer : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
(describe-function 'save-current-buffer)
val save_excursion : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
(describe-function 'save-excursion)
val save_mark_and_excursion : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
(describe-function 'save-mark-and-excursion)
val save_restriction : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
(describe-function 'save-restriction)
val set_multibyte : bool -> unit
(describe-function 'set-buffer-multibyte)
.(Info-goto-node "(elisp)Selecting a Representation")
.
val rename_exn : ?unique:bool -> unit -> name:string -> unit
rename_exn
renames the current buffer, raising ifname
is already taken andunique = false
; withunique = true
it generates a new name.(describe-function 'rename-buffer)
.
val set_text_property : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> 'a Ecaml.Text.Property_name.t -> 'a -> unit
(describe-function 'put-text-property)
(Info-goto-node "(elisp)Changing Properties")
.
val set_text_property_staged : 'a Ecaml.Text.Property_name.t -> 'a -> (start:int -> end_:int -> unit) Core_kernel.Staged.t
set_text_property_staged
is an optimization ofset_text_property
for the same text property on a number of regions, where the positions areint
s. It precomputes the Elisp property value once, and reuses it for each region.
val set_text_properties : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> Ecaml.Text.Property.t list -> unit
(describe-function 'set-text-properties)
(Info-goto-node "(elisp)Changing Properties")
.
val set_text_properties_staged : Ecaml.Text.Property.t list -> (start:int -> end_:int -> unit) Core_kernel.Staged.t
set_text_properties_staged
is an optimization ofset_text_properties
for the same text property on a number of regions, where the positions areint
s. It precomputes the Elisp property value once, and reuses it for each region.
val get_text_property : Ecaml.Position.t -> 'a Ecaml.Text.Property_name.t -> 'a option
(describe-function 'get-text-property)
val add_text_properties : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> Ecaml.Text.Property.t list -> unit
(describe-function 'add-text-properties)
(Info-goto-node "(elisp)Changing Properties")
.
val add_text_properties_staged : Ecaml.Text.Property.t list -> (start:int -> end_:int -> unit) Core_kernel.Staged.t
add_text_properties_staged
is an optimization ofadd_text_properties
for the same text property on a number of regions, where the positions areint
s. It precomputes the Elisp property value once, and reuses it for each region.
val text_property_is_present : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> _ Ecaml.Text.Property_name.t -> bool
text_property_is_present property_name
returnstrue
if any text in the region fromstart
toend_
usesproperty_name
.(describe-function 'text-property-not-all)
val set_marker_position : Ecaml.Marker.t -> Ecaml.Position.t -> unit
(describe-function 'set-marker)
(Info-goto-node "(elisp)Moving Markers")
val mark : unit -> Ecaml.Marker.t
(describe-function 'mark-marker)
(Info-goto-node "(elisp)The Mark")
val set_mark : Ecaml.Position.t -> unit
(describe-function 'set-mark)
(Info-goto-node "(elisp)The Mark")
val mark_is_active : unit -> bool
(describe-variable 'mark-active)
(Info-goto-node "(elisp)The Mark")
val active_region : unit -> (Ecaml.Position.t * Ecaml.Position.t) option
(describe-function 'region-beginning)
(describe-function 'region-end)
Returns
(region-beginning), (region-end)
if the mark is active.
val deactivate_mark : unit -> unit
(describe-function 'deactivate-mark)
(Info-goto-node "(elisp)The Mark")
val syntax_class : Ecaml.Char_code.t -> Ecaml.Syntax_table.Class.t
(describe-function 'char-syntax)
(Info-goto-node "(elisp)Syntax Table Functions")
val syntax_table : unit -> Ecaml.Syntax_table.t
(describe-function 'syntax-table)
(Info-goto-node "(elisp)Syntax Table Functions")
val set_syntax_table : Ecaml.Syntax_table.t -> unit
(describe-function 'set-syntax-table)
(Info-goto-node "(elisp)Syntax Table Functions")
val delete_lines_matching : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> Ecaml.Regexp.t -> unit
(describe-function 'flush-lines)
val sort_lines : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> unit -> unit
(describe-function 'sort-lines)
(Info-goto-node "(elisp)Sorting")
val delete_duplicate_lines : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> unit -> unit
(describe-function 'delete-duplicate-lines)
val indent_region : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> unit -> unit
(describe-function 'indent-region)
(Info-goto-node "(elisp)Region Indent")
val revert : ?confirm:bool -> unit -> unit Async_kernel.Deferred.t
(describe-function 'revert-buffer)
(Info-goto-node "(elisp)Reverting")
val set_revert_buffer_function : Core_kernel.Source_code_position.t -> (unit, 'a) Ecaml.Defun.Returns.t -> (confirm:bool -> 'a) -> unit
(describe-variable 'revert-buffer-function)
val replace_buffer_contents : (Ecaml__.Import.Buffer.t -> unit) Core_kernel.Or_error.t
(describe-function 'replace-buffer-contents)
This function was introduced in Emacs 26 and the value is an error if an earlier version of emacs is used.
val replace_string : ?start:Ecaml.Position.t -> ?end_:Ecaml.Position.t -> from:string -> to_:string -> unit -> unit
replace_string ~from ~to_
replaces all occurrences offrom
withto_
. 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.
val truncate_lines : bool Ecaml.Buffer_local.t
(describe-variable 'truncate-lines)
val chars_modified_tick : unit -> Ecaml.Modified_tick.t
(describe-function 'buffer-chars-modified-tick)
(Info-goto-node "(elisp)Buffer Modification")
val append_to : string -> unit
append_to string
appendsstring
to the end of the current buffer, and preserves point-at-max for windows that display it.
val inhibit_read_only : (_, 'a) Ecaml.Sync_or_async.t -> (unit -> 'a) -> 'a
val line_and_column_of_position : Ecaml.Position.t -> Ecaml.Line_and_column.t
val position_of_line_and_column : Ecaml.Line_and_column.t -> Ecaml.Position.t