From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: David MENTRE <dmentre@linux-france.org>,
Nicolas Ojeda Bar <n.oje.bar@gmail.com>,
caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] How can I change the margin size in the toplevel?
Date: Wed, 23 Sep 2015 18:39:31 +0200 [thread overview]
Message-ID: <CAPFanBFO=tgxtAxjPUu9YYuTuBVFkf+r1yhPQwPLK38GQ7VkGg@mail.gmail.com> (raw)
In-Reply-To: <m2y4fxjf3y.fsf@charm-ecran.irisa.fr>
For the record, Simon Cruanes is trying to find a good fix for the
issue, with a preliminary patch proposal in
https://github.com/ocaml/ocaml/pull/207
Maybe we could discuss the implementation there (or in a new Mantis
ticket) rather than on the mailing-list directly.
(There are wonderful people that prepare summaries of mailing-list
discussions, you know, they probably have to read all the messages,
let's not create too much work.)
On Wed, Sep 23, 2015 at 6:05 PM, Alan Schmitt
<alan.schmitt@polytechnique.org> wrote:
> On 2015-09-23 14:23, Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Is there a guide somewhere that explains how to create a new opam switch
>> From local (modified) ocaml sources?
>
> A very helpful colleague gave me a crash course on nix and I was able to
> compile a patched version (where I tweaked error_of_printer in
> parsing/location.ml as follows):
>
> #+begin_src ocaml
> let error_of_printer loc print x =
> let buf = Buffer.create 64 in
> let ppf = Format.formatter_of_buffer buf in
> Format.pp_set_margin ppf (Format.pp_get_margin !formatter_for_warnings ());
> pp_print_string ppf "Error: ";
> print ppf x;
> pp_print_flush ppf ();
> let msg = Buffer.contents buf in
> errorf ~loc "%s" msg
> #+end_src
>
> This works great: I can now change the margin of the error messages
> simply by doing a "Format.set_margin" in the toplevel.
>
> Alan
>
> --
> OpenPGP Key ID : 040D0A3B4ED2E5C7
> Athmospheric CO₂ (Updated September 22, 2015, Mauna Loa Obs.): 397.77 ppm
next prev parent reply other threads:[~2015-09-23 16:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 14:20 Alan Schmitt
2015-09-22 17:14 ` Emilio Jesús Gallego Arias
2015-09-23 6:48 ` Alan Schmitt
2015-09-23 7:26 ` David MENTRE
2015-09-23 12:23 ` Alan Schmitt
2015-09-23 16:05 ` Alan Schmitt
2015-09-23 16:39 ` Gabriel Scherer [this message]
2015-09-23 10:25 ` Emilio Jesús Gallego Arias
2015-09-23 11:34 ` Gerd Stolpmann
2015-09-23 12:16 ` Alan Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPFanBFO=tgxtAxjPUu9YYuTuBVFkf+r1yhPQwPLK38GQ7VkGg@mail.gmail.com' \
--to=gabriel.scherer@gmail.com \
--cc=alan.schmitt@polytechnique.org \
--cc=caml-list@inria.fr \
--cc=dmentre@linux-france.org \
--cc=n.oje.bar@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox