Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The logic in this patch is wrong: - setting the margins is not the responsibility of the color-handling code - because setup_colors is called at inpredictable times (on the first error/warning), the logic makes it very difficult to correctly set margins for `{str,err}_formatter` The patch was originally proposed in the caml-list discussion https://sympa.inria.fr/sympa/arc/caml-list/2015-09/msg00164.html but it does not convincingly solve the problem: - there is no reason to use `std_formatter` rather than `err_formatter` as a reference, and - the user can set the both margins themselves anyway. In particular, since the 4.08 changes to error/warning representations, we don't use intermediary str_formatter anymore to generate error/warning messages, so setting `Formatter.err_formatter` directly works properly when it is used to print messages. Note: We have an API in `Location` to access and configure error/warning formatters, but it is not accessible from the toplevel. Changing the margins without using this API is fragile. For example, utop and expect-tests change the formatter away from the default.
- Loading branch information