package ecaml

  1. Overview
  2. Docs
Library for writing Emacs plugin in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=87e76473915e12d718096100a5c4d15d98aba6f99ecbf21814b7389e8c28bb25

doc/ecaml/Ecaml/Ansi_color/index.html

Module Ecaml.Ansi_colorSource

Ansi_color translates ANSI escape sequences to Emacs faces, like (find-library "ansi-color"). Ansi_color is significantly faster than ansi-color, especially on larger inputs.

Sourceval color_region_in_current_buffer : start:Position.t -> end_:Position.t -> ?use_temp_file:bool -> ?preserve_state:bool -> ?drop_unsupported_escapes:bool -> unit -> unit

color_region_in_current_buffer modifies the given region in the current buffer, deleting ANSI color escapes and applying their corresponding Emacs faces to the text they affect. use_temp_file = true can speed up coloring on large inputs but since it works by deleting and reinserting the region's text, it could drop existing text properties and markers in the region and maybe mess up the point. If use_temp_file = false then the point is preserved. If preserve_state is true, then the colorization state is preserved between calls, which is useful when buffers contain partial output (like in shell-mode), allowing colorization to continue where previous call left off.

Sourceval color_current_buffer : unit -> unit

color_current_buffer is similar to color_region_in_current_buffer where the region is the whole buffer but it always uses use_temp_file = true. Saving the buffer after calling color_current_buffer would save without the escapes, which is probably not desired, so color_current_buffer marks the buffer as not modified. It also turns off undo. After colorization point is set to the beginning of the buffer.

Sourceval max_supported_code : int
Sourcemodule Colors : sig ... end

(describe-variable 'ansi-color-names-vector. Colors uses the colors in ansi-colors-names-vector when translating ANSI color codes to faces.

Sourceval print_state_machine : bool Core.ref

print_state_machine = true causes color* functions to print_s the state machine used for coloring. This is used for testing.

Sourceval show_invalid_escapes : bool Customization.t

A customization variable governing whether invalid ANSI escape sequences are flagged in output.

OCaml

Innovation. Community. Security.