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 CEF177EE49 for ; Mon, 18 Feb 2013 10:45:28 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of louis.gesbert@ocamlpro.com) identity=pra; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; x-sender="louis.gesbert@ocamlpro.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of louis.gesbert@ocamlpro.com) identity=mailfrom; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; x-sender="louis.gesbert@ocamlpro.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.171 as permitted sender) identity=helo; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; 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: ApwAAAv3IVHU436rimdsb2JhbABFhW9auViBBBYOAQEBCgkNBxIFJIIfAQEFDBdPBxAJAhgCAiYCAiE2GYgAAxMIkjWbAYd1DYlWBIEjh36DOIIrMwcWgheBEwOUUY0eiB0 X-IPAS-Result: ApwAAAv3IVHU436rimdsb2JhbABFhW9auViBBBYOAQEBCgkNBxIFJIIfAQEFDBdPBxAJAhgCAiYCAiE2GYgAAxMIkjWbAYd1DYlWBIEjh36DOIIrMwcWgheBEwOUUY0eiB0 X-IronPort-AV: E=Sophos;i="4.84,686,1355094000"; d="scan'208";a="2545493" Received: from moutng.kundenserver.de ([212.227.126.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Feb 2013 10:45:28 +0100 Received: from ocp-dell.localnet (reverse.completel.net [213.30.181.210]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0LmjjU-1Uo75e15ZM-00h2Br; Mon, 18 Feb 2013 10:45:26 +0100 From: Louis Gesbert Organization: OCamlPro To: caml-list@inria.fr Date: Mon, 18 Feb 2013 10:50:36 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) Cc: =?utf-8?q?T=C3=B6r=C3=B6k_Edwin?= References: <201302081625.29881.louis.gesbert@ocamlpro.com> <512121DB.1080405@etorok.net> In-Reply-To: <512121DB.1080405@etorok.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201302181050.37011.louis.gesbert@ocamlpro.com> X-Provags-ID: V02:K0:cYCbZUoKcvwUMg71Q7i9KuLKi2Qk1CFwFCWTlROupqq xXEfSeVd7HjRqmNx71gTwmlkry8jPXoaQD7bZWUPfFswfAKDIn HyMHQRgT5oxrDXxJGrFHnL04CM6kOVHaDWN7vKHmW1GzacxDeS Vb3P7pEdCrD9fnQ1f+4Ps04n+BsFaG3Zhn2w306ZwkffzaIxCZ cPgiwg7GNfUROFbLXbOyFcxyLqdDsk52mjomeSiHEtntMD8mlP VcNI/oMA9RxAfGcvrUTvzCExUgBSp8YECPcvLOvnal8sTmGc5A wAK3tjHg/wi9UQZUaOxVEpeEJGsNVVqky9fC795gsWLnLSBknW iaNbSVaGN3wYdAlJAPfSKmXtmkn4+Wrslu+0utZqedMBaNB65z DmNWWxG9PWhSQ== X-Validation-by: louis.gesbert@ocamlpro.com Subject: Re: [Caml-list] ocp-indent 1.0.0 release You can use the --lines option for that purpose: it will assume that all li= nes=20 not in the interval are correctly indented, and indent the lines in the=20 interval relative to that (to some extent, see=20 https://github.com/OCamlPro/ocp-indent/issues/39). In your example, you could use '--lines 2-' However, that supposes that the block you submit is more or less syntactica= lly=20 correct. You can also submit the whole file with '--lines ' t= o=20 guarantee the syntax but indent only the current line; that is how it is do= ne=20 in the emacs mode when you press TAB. Don't hesitate to submit on https://github.com/OCamlPro/ocp- indent/issues?state=3Dopen for further discussion if you are reluctant on= =20 spamming the caml-list. -- Louis, OCamlPro Le Sunday 17 February 2013 19:30:51, T=C3=B6r=C3=B6k Edwin a =C3=A9crit : > On 02/17/2013 08:05 PM, Raphael Proust wrote: > > On Sat, Feb 16, 2013 at 8:34 PM, Niki Yoshiuchi wro= te: > >> The second thing I've noticed is that "=3D" indents only relative to t= he > >> selected text. In other words, if I have > >>=20 > >>=20 > >> let my_fun f =3D > >> . . let nested_fun g =3D > >> . . . . (* content *) > >> . . . . (* more content *) > >>=20 > >> and I hit "=3D" while the cursor is on the third line I end up with: > >>=20 > >> let my_fun f =3D > >> . . let nested_fun g =3D > >> (* content *) > >> . . . . (* more content *) > >>=20 > >> Doing something like "ggVG=3D" will properly indent the text. > >=20 > > This is the expected behaviour. ocp-indent is only given the selected > > text and thus can only work correctly when receiving complete blocks. > > (Indentation is relative to the first line of the chunk that is > > passed.) >=20 > Could ocp-indent consider the indentation of the first line to be correct > when it is working on incomplete blocks, and indent everything in relation > to that? i.e. call ocp-indent with a new flag --incomplete, and if first > line got 2 spaces, then have the starting indentation be 2 spaces, and > then increase/decrease indentation relative to that. That seems how vim's > '=3D' works for other languages, or without ocp-indent. >=20 > Best regards, > --Edwin