Skip to content

Commit

Permalink
Merge pull request ocaml#9197 from gasche/improve-lambda-printing
Browse files Browse the repository at this point in the history
formatter margins and color handling: revert ocaml#244
  • Loading branch information
Armael committed Dec 21, 2019
2 parents d0fe00c + 8c36e79 commit 61d2352
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Changes
Expand Up @@ -60,6 +60,19 @@ Working version
symbol in both the static and the dynamic symbol tables.
(Sébastien Hinderer, review by Gabriel Scherer and David Allsopp)

* #9197: remove compatibility logic from #244 that was designed to
synchronize toplevel printing margins with Format.std_formatter,
but also resulted in unpredictable/fragile changes to formatter
margins.
Setting the margins on the desired formatters should now work.
typically on `Format.std_formatter`.
Note that there currently is no robust way to do this from the
toplevel, as applications may redirect toplevel printing. In
a compiler/toplevel driver, one should instead access
`Location.formatter_for_warnings`; it is not currently exposed
to the toplevel.
(Gabriel Scherer, review by Armaël Guéneau)

### Manual and documentation:

- #9141: beginning of the ocamltest reference manual
Expand Down
2 changes: 0 additions & 2 deletions utils/misc.ml
Expand Up @@ -693,8 +693,6 @@ module Color = struct
} in
pp_set_mark_tags ppf true; (* enable tags *)
pp_set_formatter_stag_functions ppf functions';
(* also setup margins *)
pp_set_margin ppf (pp_get_margin std_formatter());
()

external isatty : out_channel -> bool = "caml_sys_isatty"
Expand Down

0 comments on commit 61d2352

Please sign in to comment.