Hello, On 2015-09-23 13:34, Gerd Stolpmann writes: > Am Mittwoch, den 23.09.2015, 12:25 +0200 schrieb Emilio Jesús Gallego > Arias: >> Hi Alan, >> >> The code seems to have changed in the last months (likely due to color >> support), but the corresponding code in trunk is at parsing/location.ml:335. >> >> Indeed, this little hack works for me(TM): >> >> 8<--------------------------------------------------------------------8< >> Index: parsing/location.ml >> =================================================================== >> --- parsing/location.ml (revision 16441) >> +++ parsing/location.ml (working copy) >> @@ -333,6 +333,7 @@ >> let pp_ksprintf ?before k fmt = >> let buf = Buffer.create 64 in >> let ppf = Format.formatter_of_buffer buf in >> + Format.pp_set_margin ppf (200 + 1); >> Misc.Color.set_color_tag_handling ppf; >> begin match before with >> | None -> () >> 8<--------------------------------------------------------------------8< >> >> I don't know what would be the proper way to integrate it upstream. Thank you for tracking down where the formatter is created. It makes sense now why I was not able to change these margins. > Maybe to propagate the margin? > > Format.pp_set_margin ppf (Format.pp_get_margin Format.std_formatter()) > > Don't know whether std_formatter or err_formatter is the right one. It’s not clear. The formatter for warnings is set by default to the error formatter (https://github.com/ocaml/ocaml/blob/b860d631458802c8685aa59c9d7b66a9225fcedb/parsing/location.ml#L309) but the toplevel loop sets it to the std formatter (the loop is called with std_formatter, https://github.com/ocaml/ocaml/blob/b860d631458802c8685aa59c9d7b66a9225fcedb/parsing/location.ml#L309). So a solution could be to reuse its value: Format.pp_set_margin ppf (Format.pp_get_margin !formatter_for_warnings ()) Thanks again, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO₂ (Updated September 22, 2015, Mauna Loa Obs.): 397.77 ppm