package ecaml
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=87e76473915e12d718096100a5c4d15d98aba6f99ecbf21814b7389e8c28bb25
doc/ecaml/Ecaml/Ansi_color/index.html
Module Ecaml.Ansi_color
Source
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.
val 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.
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.
(describe-variable 'ansi-color-names-vector
. Colors
uses the colors in ansi-colors-names-vector
when translating ANSI color codes to faces.
print_state_machine = true
causes color*
functions to print_s
the state machine used for coloring. This is used for testing.
A customization variable governing whether invalid ANSI escape sequences are flagged in output.