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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 5C1E47F20B for ; Tue, 12 Feb 2013 12:33:02 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gesbert@antislash.info) identity=pra; client-ip=212.227.17.9; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gesbert@antislash.info"; x-sender="gesbert@antislash.info"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gesbert@antislash.info) identity=mailfrom; client-ip=212.227.17.9; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gesbert@antislash.info"; x-sender="gesbert@antislash.info"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.17.9 as permitted sender) identity=helo; client-ip=212.227.17.9; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gesbert@antislash.info"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhoBACknGlHU4xEJfGdsb2JhbABEhUS7bxYOAQELCQsHFAUkgiABBSdiC0ZXiC8IrwyQDYkEhVmDKgOIMIUtiWSSPQ X-IPAS-Result: AhoBACknGlHU4xEJfGdsb2JhbABEhUS7bxYOAQELCQsHFAUkgiABBSdiC0ZXiC8IrwyQDYkEhVmDKgOIMIUtiWSSPQ X-IronPort-AV: E=Sophos;i="4.84,648,1355094000"; d="scan'208";a="2476858" Received: from moutng.kundenserver.de ([212.227.17.9]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 12 Feb 2013 12:33:02 +0100 Received: from agaric.localnet (jua06-3-88-189-115-104.fbx.proxad.net [88.189.115.104]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MDkte-1U7xOF2xl0-00GcSv; Tue, 12 Feb 2013 12:33:01 +0100 From: Louis Gesbert To: caml-list@inria.fr Date: Tue, 12 Feb 2013 12:33:00 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) References: <201302081625.29881.louis.gesbert@ocamlpro.com> <51153ACE.6070909@inria.fr> In-Reply-To: <51153ACE.6070909@inria.fr> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201302121233.00379.gesbert@antislash.info> X-Provags-ID: V02:K0:vZBrsYgNw0cu1YRbWwpAVuGzEyEvH0FC1peEDvk7KAm 8ykKN7Z3Ds8uVmnXHtW1OEbd2GxxhAIz73uvR79gHfRg7pH3xI 041PqUNm+BTaQgxyTPmipTzMEsrXYUxsrXkOVQduntBlQSC8zB i0vpHfbeOQ5+9SN4Dj+G+B+Ie4lhlZt6/xLW38NOl4D6SlZJmr ly7uBVNRPxodPpzPquEpyRl6iXCxIKGbzM/SnIORldkT4Ps41v bRrTkKgYFT9MJKRWOEiGNKB5cRz5yEXWguRMJ2URVUzcuP7vd8 0mM7VvAjyis3+WeEOsjVs+oCylJjwe1jhwOBhUyzmAR2R6Pyyv +ZD0UwgIpv+IrwXyPGergl+xUGJomgwLT03xsnJje X-Validation-by: gesbert@antislash.info Subject: Re: [Caml-list] ocp-indent beta release You can get this behaviour with `ocp-indent --config with=3D3,match_clause= =3D4` The default behaviour was chosen to reflect the most common current indenta= tion=20 practices (and the guidelines,=20 http://caml.inria.fr/resources/doc/guides/guidelines.en.html) ; I guess it = was=20 found that indenting the | doesn't improve readability and makes you run in= to=20 the right margin more quickly. -- Louis Gesbert Le vendredi 8 f=E9vrier 2013 18:50:06, Romain Bardou a =E9crit : > I tried it very quickly, it seems to work fine. >=20 > I'm curious though, when did this way of indenting pattern-matching > became a thing? When I started programming in OCaml, the default Tuareg > behavior was: >=20 > match x with >=20 > | A -> >=20 > b >=20 > Now it seems everywhere I go it's like this never existed. >=20 > Cheers, >=20 > > OCamlPro is proud to announce the beta-release of ocp-indent. > >=20 > > Ocp-indent is a simple tool, entirely written in OCaml, which sole > > purpose is to indent OCaml code. It can plug-in seamlessly into emacs' > > tuareg mode, or be run from vim. > >=20 > > You can try it now with: > >=20 > > $ opam install ocp-indent > >=20 > > $ INSTDIR=3D"$(opam config var prefix)/share/typerex/ocp-indent" > >=20 > > $ echo '(load-file "'"$INSTDIR/ocp-indent.el"'")'>>~/.emacs > >=20 > > $ echo 'autocmd FileType ocaml source > > '"$INSTDIR"'/ocp-indent.vim'>>~/.vimrc > >=20 > >=20 > > Or check it out at https://github.com/OCamlPro/ocp-indent > >=20 > >=20 > >=20 > > It presents many improvements over the tuareg indentation engine, a much > > better understanding of the syntax, linear complexity, specific handling > > for many cases. Also, it was intentionally provided with much less > > customisation options. > >=20 > > Feel free to submit any code snippet that is not indented to your taste, > > to help us improve ocp-indent further. > >=20 > >=20 > > Some comparison with tuareg on a few big OCaml projects can be seen at > > http://htmlpreview.github.com/?https://github.com/AltGr/ocp-indent- > > tests/blob/master/status.html > >=20 > >=20 > > -- > > Louis Gesbert, OCamlPro