Richard Bonichon Table of Contents ───────────────── 1 Merlin (confirmed) 2 Utop (confirmed) .. 2.1 Patching 3 Topkg (invalid) 4 Frama-c base (confirmed) 5 Summary 1 Merlin (confirmed) ════════════════════ ┌──── │ erlin.2.5.3/src/ocaml_404/parsing/location.ml │ 79: let out_string str start len = │ 85: out_functions.out_string str start len in │ 87: { out_functions with out_string } ; │ │ merlin.2.5.3/src/ocaml_402/parsing/location.ml │ 76: let out_string str start len = │ 82: out_functions.out_string str start len in │ 84: { out_functions with out_string } ; │ │ merlin.2.5.3/src/ocaml_403/parsing/location.ml │ 79: let out_string str start len = │ 85: out_functions.out_string str start len in │ 87: { out_functions with out_string } ; │ │ merlin.2.5.3/orig/ocaml_404/parsing/location.ml │ 81: let out_string str start len = │ 87: out_functions.out_string str start len in │ 89: { out_functions with out_string } ; │ │ merlin.2.5.3/orig/ocaml_402/parsing/location.ml │ 78: let out_string str start len = │ 84: out_functions.out_string str start len in │ 86: { out_functions with out_string } ; │ │ merlin.2.5.3/orig/ocaml_403/parsing/location.ml │ 81: let out_string str start len = │ 87: out_functions.out_string str start len in │ 89: { out_functions with out_string } ; └──── No changes required here. Would work out of the box 2 Utop (confirmed) ══════════════════ ┌──── │ utop.1.19.3/src/lib/uTop.cppo.ml │ 148: let out_string str ofs len = Buffer.add_substring buf str ofs len │ 152: let out_functions = { Format.out_string; out_flush; out_newline; out_spaces } in │ 181: Format.out_string = (fun _ _ _ -> ()); out_flush = ignore; └──── 3 uses confirmed for the 3 other record field functions as well 2.1 Patching ──────────── ┌──── │ let collect_formatters buf pps f = │ (* First flush all formatters. *) │ List.iter (fun pp -> Format.pp_print_flush pp ()) pps; │ (* Save all formatter functions. *) │ let save = List.map (fun pp -> Format.pp_get_formatter_out_functions pp ()) pps in │ let restore () = │ List.iter2 │ (fun pp out_functions -> │ Format.pp_print_flush pp (); │ Format.pp_set_formatter_out_functions pp out_functions) │ pps save │ in │ (* Output functions. *) │ let out_string str ofs len = Buffer.add_substring buf str ofs len │ and out_flush = ignore │ and out_newline () = Buffer.add_char buf '\n' │ and out_spaces n = for i = 1 to n do Buffer.add_char buf ' ' done in │ let out_functions = { Format.out_string; out_flush; out_newline; out_spaces } in └──── Instead of defining the formatter from `out_functions', one could just make a formatter out of a buffer and get its `out_functions'. This patch is present in one our PR since the same code exists in OCaml's testsuite. 3 Topkg (invalid) ═════════════════ This is a false alarm. Only `out_string' is found, none of the others ┌──── │ ➜ src ag out_string topkg.0.8.1 │ topkg.0.8.1/src/topkg_os.mli │ 65: val out_string : ?trim:bool -> run_out -> (string * run_status) result │ │ topkg.0.8.1/src/topkg_vcs.ml │ 58: Topkg_os.Cmd.(run_out ~err:Topkg_os.File.null git_dir |> out_string) │ 74: Topkg_os.Cmd.(run_out ~err:Topkg_os.File.null status |> out_string) │ 97: run_git r Topkg_cmd.(v "rev-parse" % "HEAD") Topkg_os.Cmd.out_string │ 105: run_git r id Topkg_os.Cmd.out_string >>= fun id -> dirtify_if ~dirty r id │ 109: run_git r time Topkg_os.Cmd.out_string │ 118: Topkg_os.Cmd.out_string │ 148: Topkg_os.Cmd.out_string │ 179: Topkg_os.Cmd.(run_out ~err:Topkg_os.File.null hg_root |> out_string) │ 192: run_hg r Topkg_cmd.(v "id" % "-i" % "--rev" % rev) Topkg_os.Cmd.out_string │ 203: run_hg r Topkg_cmd.(v "status" % p file) Topkg_os.Cmd.out_string >>= function │ 219: run_git r time Topkg_os.Cmd.out_string │ 229: Topkg_os.Cmd.out_string │ 265: run_hg r Topkg_cmd.(v "update" % "--rev" % rev) Topkg_os.Cmd.out_string │ 269: run_hg r Topkg_cmd.(v "branch" % branch) Topkg_os.Cmd.out_string │ │ topkg.0.8.1/src/topkg_os.ml │ 264: let out_string ?(trim = true) o = │ 271: out_string ?trim o >>= function (s, st) -> │ 277: let to_string ?trim o = out_string ?trim o |> success │ │ topkg.0.8.1/src/topkg.mli │ 476: val out_string : ?trim:bool -> run_out -> (string * run_status) result │ 477: (** [out_string ~trim o] captures the standard output [o] as a [string]. │ 482: (** [out_lines ~trim] is like {!out_string} but the result is │ 493: (** [to_string] is [(out_string ?trim o |> success)]. *) │ 496: (** [to_lines ?trim o] is [(out_string ?trim o |> success)]. *) │ │ topkg.0.8.1/src-care/topkg_care_pkg.ml │ 356: OS.Cmd.(run_out ~err:err_run_out Cmd.(cmd % p file) |> out_string) │ 414: match OS.Cmd.(run_out ~err Cmd.(cmd % p file) |> out_string) with │ │ topkg.0.8.1/src-bin/distrib.ml │ 17: let out = OS.Cmd.out_string in │ 27: let out = OS.Cmd.out_string in └──── 4 Frama-c base (confirmed) ══════════════════════════ It is used but will not require any changes. ┌──── │ frama-c-base.20161101/src/plugins/aorai/promelaoutput.ml │ 139: if !has_printed then funcs.Format.out_string " \\\n" 0 3 │ 142: let out_string s b l = │ 145: funcs.Format.out_string s b l └──── 5 Summary ═════════ Only 3 packages uses directly Format's pretty-printing record to build formatters. Two of them will not require any change. Only `utop' would have to adad