From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 A3FCB7F734 for ; Mon, 21 Sep 2015 16:20:21 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.17,568,1437429600"; d="asc'?scan'208";a="148047319" Received: from charm-ecran.irisa.fr (HELO top.local) ([131.254.101.83]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 21 Sep 2015 16:20:14 +0200 From: Alan Schmitt To: OCaml Mailing List Date: Mon, 21 Sep 2015 16:20:18 +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: [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, I=E2=80=99m writing some slides for an ocaml course that contain the output= sent by the toplevel, such as the following: # let x =3D 1 + "toto";; Error: This expression has type string but an expression was expected of ty= pe int As the messages are too wide to fit on the width of the slide, they are put in an environment that wraps them. The results look like this: Characters 12-18: let x =3D 1 + "toto";; ^^^^^^ Error: This expression has type string but an expression was expected of type int I=E2=80=99m trying to get rid of the line break before =E2=80=9Cint=E2=80= =9D, and looking at the code, I see that the toplevel uses Format with break hints for these messages, so I should be able to do this by setting the margin to a big number. Unfortunately I don=E2=80=99t seem to be able to change the margin = of the formatter used in the toplevel. I tried both: Format.pp_set_margin Format.err_formatter 200 and Format.pp_set_margin Format.std_formatter 200 inside the toplevel but it does not change the formatter for these messages. Is there a way to access the formatter used by the toplevel? And if not, is it possible to change the column at which word wrap happens? Thanks, Alan --=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Last week athmospheric CO=E2=82=82 average (Updated September 13, 2015, Mau= na Loa Obs.): 397.77 ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWABIiAAoJEAQNCjtO0uXHybcIALEs0RcaWF/YlfbbELRcOUeu zI4WhB67cjUhKHb4rp/VAZ2vBR0fy8viTZhfTsRsTq9nonImrhaoISg9wb40s+TI 75xJlBuYER8l6HKEsFIKYfpElooiqF+wTEJO/+nCIGdOBaGurBceh9T0GRH64ouF UlCPBTM7QMpfW/yCJg6XfoqH6B2sIowEYvs9wG9aGsIjCkVPC5YGBaSLyIEOwgUk LSddO/bEnY8oTwvsnMa1rLwXrUYRLqNJXooaKcGFhvtEfo3jxaH0bxr0xxDKWmKb /ZbHqxXTvXwwXcUhQRHP9NfgrkquLoGywxQM1PV0C9fdMKy2LfICAVt2ub3GxM0= =jX53 -----END PGP SIGNATURE----- --=-=-=--