From 296fd47808c5642903a81bf6a87bf291ae15abfd Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Wed, 7 Mar 2018 13:47:57 -0500 Subject: [toplevel] Respect COQ_COLORS environment variable Since 3fc02bb2034a ("[pp] Move terminal-specific tagging to the toplevel."), the COQ_COLORS environment variable has been ignored, since init_terminal_output unconditionally called init_tag_map with the default colors, overwriting any custom colors that had been previously set. Fix this by creating a separate function, default_styles, to set the default colors. Also, remove the clear_styles function, as it was only called in one place and did nothing (since tag_map is empty to begin with). --- vernac/topfmt.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vernac/topfmt.ml') 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 = { -- cgit v1.2.3