From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id B23537F734 for ; Wed, 23 Sep 2015 14:16:11 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.17,577,1437429600"; d="asc'?scan'208";a="179070748" Received: from charm-ecran.irisa.fr ([131.254.101.83]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 23 Sep 2015 14:16:11 +0200 From: Alan Schmitt To: Gerd Stolpmann Cc: Emilio =?utf-8?Q?Jes=C3=BAs?= Gallego Arias , caml-list@inria.fr References: <84io72z88q.fsf@cri.ensmp.fr> <877fnh77pk.fsf@cri.ensmp.fr> <1443008077.4442.1.camel@e130.lan.sumadev.de> Date: Wed, 23 Sep 2015 14:16:08 +0200 In-Reply-To: <1443008077.4442.1.camel@e130.lan.sumadev.de> (Gerd Stolpmann's message of "Wed, 23 Sep 2015 13:34:37 +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 Hello, On 2015-09-23 13:34, Gerd Stolpmann writes: > Am Mittwoch, den 23.09.2015, 12:25 +0200 schrieb Emilio Jes=C3=BAs Gallego > Arias: >> Hi Alan, >>=20 >> 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. >>=20 >> Indeed, this little hack works for me(TM): >>=20 >> 8<--------------------------------------------------------------------8< >> Index: parsing/location.ml >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- parsing/location.ml (revision 16441) >> +++ parsing/location.ml (working copy) >> @@ -333,6 +333,7 @@ >> let pp_ksprintf ?before k fmt =3D >> let buf =3D Buffer.create 64 in >> let ppf =3D 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< >>=20 >> 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=E2=80=99s not clear. The formatter for warnings is set by default to the error formatter (https://github.com/ocaml/ocaml/blob/b860d631458802c8685aa59c9d7b66a9225fce= db/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/b860d631458802c8685aa59c9d7b66a9225fced= b/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 --=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 iQEcBAEBCgAGBQJWApgIAAoJEAQNCjtO0uXHjyMIAIab7f9OIV5hgTj5dA2+NtoU mf9ETiemukOGq1la/NZho1rqCD8f4Md5LE012VOudNw/bX9jyooAkmFqTpgCJjnU 7eHOEHj3c1VANZ9eSCf/kxpn6/KSfK2zhgrA3s9AnXnNELcrEkkf/PZAJxzzo0Sp igOPx8WzuuHCql6WinoTy1ktWV8F9p3rf5MNePXVtiJNlp8RMe2cQpU7NCO11aTg UN1u3XasxN6pDprrYr7lF+VcxqsHlAjGQCo3JBsd8s/KFvW3M1AeBCVHg6DpYiBz lgwEKzbJS+R7Ei2G5DmDPclWwquGRWrOac9oZpbkwF/9f4CM0D9JZRLQALWFw/4= =Ys0U -----END PGP SIGNATURE----- --=-=-=--