aboutsummaryrefslogtreecommitdiffhomepage
path: root/printing
diff options
context:
space:
mode:
Diffstat (limited to 'printing')
-rw-r--r--printing/ppstyle.ml8
-rw-r--r--printing/ppstyle.mli5
2 files changed, 9 insertions, 4 deletions
diff --git a/printing/ppstyle.ml b/printing/ppstyle.ml
index 9839b627b..5585d4b7f 100644
--- a/printing/ppstyle.ml
+++ b/printing/ppstyle.ml
@@ -103,6 +103,10 @@ let debug_tag =
let style = Terminal.make ~bold:true ~fg_color:`WHITE ~bg_color:`MAGENTA () in
make ~style ["message"; "debug"]
+let pp_tag t = match Pp.Tag.prj t tag with
+| None -> ""
+| Some key -> key
+
let init_color_output () =
let push_tag, pop_tag, clear_tag = make_style_stack !tags in
let tag_handler = {
@@ -111,10 +115,6 @@ let init_color_output () =
Format.print_open_tag = ignore;
Format.print_close_tag = ignore;
} in
- let pp_tag t = match Pp.Tag.prj t tag with
- | None -> ""
- | Some key -> key
- in
let open Pp_control in
let () = Format.pp_set_mark_tags !std_ft true in
let () = Format.pp_set_mark_tags !err_ft true in
diff --git a/printing/ppstyle.mli b/printing/ppstyle.mli
index e6e664f79..b6aa0e694 100644
--- a/printing/ppstyle.mli
+++ b/printing/ppstyle.mli
@@ -53,6 +53,11 @@ val init_color_output : unit -> unit
with additional syle information provided by this module. Be careful this is
not compatible with the Emacs mode! *)
+val pp_tag : Pp.tag_handler
+(** Returns the name of a style tag that is understandable by the formatters
+ that have been inititialized through {!init_color_output}. To be used with
+ {!Pp.pp_with}. *)
+
(** {5 Tags} *)
val error_tag : t