package ecaml
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").
(describe-function 'current-buffer)
(describe-function 'set-buffer)
val set_temporarily :
(_, 'a) Sync_or_async.t ->
Ecaml_value__.Value0.t ->
f:(unit -> 'a) ->
'aset_temporarily t ~f runs f with the current buffer set to t. (describe-function 'with-current-buffer).
(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.
(describe-function 'symbol-value)
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.
val set_values_temporarily :
(_, 'a) Sync_or_async.t ->
Var.And_value.t list ->
f:(unit -> 'a) ->
'aval set_buffer_local_temporarily :
(_, 'a) Sync_or_async.t ->
'b Buffer_local.t ->
'b ->
f:(unit -> 'a) ->
'a(describe-variable 'default-directory) (Info-goto-node "(elisp)File Name Expansion")
(describe-variable 'buffer-undo-list) (Info-goto-node "(elisp)Undo") (Info-goto-node "(elisp)Maintaining Undo")
(describe-function 'buffer-file-name) (Info-goto-node "(elisp)Buffer File Name")
(describe-function 'buffer-name)
(describe-variable 'buffer-file-name) (Info-goto-node "(elisp)Buffer File Name")
(describe-variable 'file-coding-system)
(describe-function 'undo-boundary) (Info-goto-node "(elisp)Undo")
(describe-function 'undo)
(describe-function 'describe-mode) (Info-goto-node "(elisp)Mode Help")
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).
(describe-function 'bury-buffer) (Info-goto-node "(elisp)Buffer List")
(describe-function 'buffer-modified-p)
(describe-function 'set-buffer-modified-p)
(describe-variable 'fill-column) (Info-goto-node "(elisp)Margins")
(describe-variable 'paragraph-start) (Info-goto-node "(elisp)Standard Regexps ")
(describe-variable 'paragraph-separate) (Info-goto-node "(elisp)Standard Regexps ")
(describe-variable 'buffer-read-only) (Info-goto-node "(elisp)Read-Only Buffers")
(describe-variable 'transient-mark-mode) (describe-function 'transient-mark-mode) (Info-goto-node "(elisp)The Mark")
(describe-variable 'major-mode) (Info-goto-node "(elisp)Auto Major Mode")
(describe-function 'set-auto-mode)
(describe-function 'make-local-variable) (Info-goto-node "(elisp)Creating Buffer-Local")
(describe-function 'local-variable-p) (Info-goto-node "(elisp)Creating Buffer-Local")
(describe-function 'local-variable-if-set-p) (Info-goto-node "(elisp)Creating Buffer-Local")
(describe-function 'buffer-local-variables) (Info-goto-node "(elisp)Creating Buffer-Local")
(describe-function 'kill-local-variable) (Info-goto-node "(elisp)Creating Buffer-Local")
(describe-function 'current-local-map) (Info-goto-node "(elisp)Controlling Active Maps")
(describe-function 'use-local-map) (Info-goto-node "(elisp)Controlling Active Maps")
(describe-function 'current-minor-mode-maps) (Info-goto-node "(elisp)Controlling Active Maps")
val contents :
?start:Position.t ->
?end_:Position.t ->
?text_properties:bool ->
unit ->
Text.t(describe-function 'buffer-substring) (describe-function 'buffer-substring-no-properties)
(Info-goto-node "(elisp)Killing Buffers") (describe-function 'kill-buffer)
(Info-goto-node "(elisp)Saving Buffers") (describe-function 'save-buffer)
(describe-function 'erase-buffer)
(describe-function 'delete-region) (Info-goto-node "(elisp)Deletion")
(describe-function 'kill-region)
(describe-function 'widen) (Info-goto-node "(elisp)Narrowing")
(describe-function 'save-current-buffer)
(describe-function 'save-excursion)
(describe-function 'save-mark-and-excursion)
(describe-function 'save-restriction)
(describe-function 'set-buffer-multibyte). (Info-goto-node "(elisp)Selecting a Representation").
(describe-variable 'enable-multibyte-characters).
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).
val 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").
val set_text_property_staged :
'a Text.Property_name.t ->
'a ->
(start:int -> end_:int -> unit) Core_kernel.Staged.tset_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.
val 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").
val set_text_properties_staged :
Text.Property.t list ->
(start:int -> end_:int -> unit) Core_kernel.Staged.tset_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.
(describe-function 'get-text-property)
val 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").
val add_text_properties_staged :
Text.Property.t list ->
(start:int -> end_:int -> unit) Core_kernel.Staged.tadd_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.
val text_property_is_present :
?start:Position.t ->
?end_:Position.t ->
_ Text.Property_name.t ->
booltext_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)
(describe-function 'set-marker) (Info-goto-node "(elisp)Moving Markers")
(describe-function 'mark-marker) (Info-goto-node "(elisp)The Mark")
(describe-function 'set-mark) (Info-goto-node "(elisp)The Mark")
(describe-variable 'mark-active) (Info-goto-node "(elisp)The Mark")
(describe-function 'region-beginning) (describe-function 'region-end)
Returns (region-beginning), (region-end) if the mark is active.
(describe-function 'deactivate-mark) (Info-goto-node "(elisp)The Mark")
(describe-function 'char-syntax) (Info-goto-node "(elisp)Syntax Table Functions")
(describe-function 'syntax-table) (Info-goto-node "(elisp)Syntax Table Functions")
(describe-function 'set-syntax-table) (Info-goto-node "(elisp)Syntax Table Functions")
(describe-function 'flush-lines)
(describe-function 'sort-lines) (Info-goto-node "(elisp)Sorting")
(describe-function 'delete-duplicate-lines)
(describe-function 'indent-region) (Info-goto-node "(elisp)Region Indent")
(describe-function 'revert-buffer) (Info-goto-node "(elisp)Reverting")
val set_revert_buffer_function :
Core_kernel.Source_code_position.t ->
(unit, 'a) Defun.Returns.t ->
(confirm:bool -> 'a) ->
unit(describe-variable 'revert-buffer-function)
(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:Position.t ->
?end_:Position.t ->
from:string ->
to_:string ->
unit ->
unitreplace_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.
(describe-function 'buffer-size)
(describe-variable 'truncate-lines)
(describe-function 'buffer-chars-modified-tick) (Info-goto-node "(elisp)Buffer Modification")
append_to string appends string to the end of the current buffer, and preserves point-at-max for windows that display it.