diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2018-03-09 13:27:35 +0100 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2018-03-09 13:27:35 +0100 |
commit | 2069c0aec44a50031e33bcb9f7d86c1535ef6b84 (patch) | |
tree | f1fb49a4d56af2579b7c9f602e5766e6f7e6daea | |
parent | ff947d85f8b8921e401b693e47c52504c71f9c4c (diff) | |
parent | 296fd47808c5642903a81bf6a87bf291ae15abfd (diff) |
Merge PR #6941: [toplevel] Respect COQ_COLORS environment variable
-rw-r--r-- | toplevel/coqtop.ml | 2 | ||||
-rw-r--r-- | vernac/topfmt.ml | 5 | ||||
-rw-r--r-- | vernac/topfmt.mli | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 341888d09..cd831c05c 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -344,13 +344,13 @@ let init_color color_mode = match colors with | None -> (** Default colors *) + Topfmt.default_styles (); Topfmt.init_terminal_output ~color:true | Some "" -> (** No color output *) Topfmt.init_terminal_output ~color:false | Some s -> (** Overwrite all colors *) - Topfmt.clear_styles (); Topfmt.parse_color_config s; Topfmt.init_terminal_output ~color:true end diff --git a/vernac/topfmt.ml b/vernac/topfmt.ml index 4e4077f42..055f6676e 100644 --- a/vernac/topfmt.ml +++ b/vernac/topfmt.ml @@ -187,8 +187,8 @@ let init_tag_map styles = let set accu (name, st) = CString.Map.add name st accu in tag_map := List.fold_left set !tag_map styles -let clear_styles () = - tag_map := CString.Map.empty +let default_styles () = + init_tag_map (default_tag_map ()) let parse_color_config file = let styles = Terminal.parse file in @@ -257,7 +257,6 @@ let make_printing_functions () = print_prefix, print_suffix let init_terminal_output ~color = - init_tag_map (default_tag_map ()); let push_tag, pop_tag, clear_tag = make_style_stack () in let print_prefix, print_suffix = make_printing_functions () in let tag_handler ft = { diff --git a/vernac/topfmt.mli b/vernac/topfmt.mli index 2fdefc6fc..579b456a2 100644 --- a/vernac/topfmt.mli +++ b/vernac/topfmt.mli @@ -43,7 +43,7 @@ val std_logger : ?pre_hdr:Pp.t -> Feedback.level -> Pp.t -> unit val emacs_logger : ?pre_hdr:Pp.t -> Feedback.level -> Pp.t -> unit (** Color output *) -val clear_styles : unit -> unit +val default_styles : unit -> unit val parse_color_config : string -> unit val dump_tags : unit -> (string * Terminal.style) list |