From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 34C497F734 for ; Wed, 23 Sep 2015 18:05:24 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.17,577,1437429600"; d="asc'?scan'208";a="148352342" Received: from cbg35-2-78-242-14-140.fbx.proxad.net (HELO charm-ecran.irisa.fr) ([78.242.14.140]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 23 Sep 2015 18:05:23 +0200 From: Alan Schmitt To: David MENTRE Cc: Nicolas Ojeda Bar , caml-list@inria.fr References: <84io72z88q.fsf@cri.ensmp.fr> <56025424.2010508@linux-france.org> Date: Wed, 23 Sep 2015 18:05:21 +0200 In-Reply-To: (Alan Schmitt's message of "Wed, 23 Sep 2015 14:23:10 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Subject: Re: [Caml-list] How can I change the margin size in the toplevel? --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-09-23 14:23, Alan Schmitt 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 =3D let buf =3D Buffer.create 64 in let ppf =3D 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 =3D 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 --=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated September 22, 2015, Mauna Loa Obs.): 397.= 77 ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWAs3BAAoJEAQNCjtO0uXHj50IAJFBcAq4kTc4aGuJc8cU+YMm d0vHzCsxAKlmWhbDDeJfhcHB6jxKEWuW4M1uxhda6p5QUiowkQ8drpsAouNehu3s nUw05h84nNQwa7EQLBrgmcJNI2DUzxF2KcIH87MllMD6+zEY/SVdGiDuCXF57M5N GjzRBoBTLJwgTsxAQm69Ie94KS9sejIiKKa3YYWJR9r9hXdJ8u9U5f4iu9G3Uuwd SsZ1sao9BLw1pEcY3fRuZSrOInKOhONZaHVQ9hZTFWOnDfTYTfFbImPj+7AebGHb q4tJRNZ7lDf23wOq5SfCJJeehMC8+NhCNUiEHBBb5MYGFwjjvn1/Sx9SF5dDcrk= =p3gq -----END PGP SIGNATURE----- --=-=-=--