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 2FA877F20B for ; Sun, 17 Feb 2013 19:30:53 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of edwin+ml-ocaml@etorok.net) identity=pra; client-ip=176.9.138.55; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="edwin+ml-ocaml@etorok.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of edwin+ml-ocaml@etorok.net designates 176.9.138.55 as permitted sender) identity=mailfrom; client-ip=176.9.138.55; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="edwin+ml-ocaml@etorok.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@mail.etorok.net designates 176.9.138.55 as permitted sender) identity=helo; client-ip=176.9.138.55; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="postmaster@mail.etorok.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgMFAJIfIVGwCYo3/2dsb2JhbABFgmaDY7lUfxZzgh8BAQUjHQEBMAYCDwsYAgIFFgsCAgkDAgECAQ82EwYCAod8AxADq2Nxg0oBBYQMDYlUBoEjizaCKzoWgheBE5RUgVuLQ4UVgwk X-IPAS-Result: AgMFAJIfIVGwCYo3/2dsb2JhbABFgmaDY7lUfxZzgh8BAQUjHQEBMAYCDwsYAgIFFgsCAgkDAgECAQ82EwYCAod8AxADq2Nxg0oBBYQMDYlUBoEjizaCKzoWgheBE5RUgVuLQ4UVgwk X-IronPort-AV: E=Sophos;i="4.84,682,1355094000"; d="scan'208";a="3240738" Received: from mail.etorok.net ([176.9.138.55]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Feb 2013 19:30:52 +0100 Received: from [IPv6:2a02:2f09:4080:81:1e6f:65ff:fe23:db0d] (unknown [IPv6:2a02:2f09:4080:81:1e6f:65ff:fe23:db0d]) by mail.etorok.net (Postfix) with ESMTPSA id 8A48246B5 for ; Sun, 17 Feb 2013 19:30:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=etorok.net; s=MAILOUT; t=1361125851; bh=oloz0EocOvtd+ELs4B/CZj8/UUUG77n6hen0qAb3gas=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=X3SeK4mAoNm5cyHFn2BD00iI4w8EnabHTy5u0s91EIxVdB2aLSj3Q/Op4hEv4cpCp rqvCo08Jg6WHPntPH2+yxiVBcuUigM/QSP0MwuRhRbUv4snJaHELTg0tsdtXFachbl 4j7MKQroYg2AC/uoTjgeokoB9EaE/HvfvUBiOGGQ= Message-ID: <512121DB.1080405@etorok.net> Date: Sun, 17 Feb 2013 20:30:51 +0200 From: =?UTF-8?B?VMO2csO2ayBFZHdpbg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: caml-list@inria.fr References: <201302081625.29881.louis.gesbert@ocamlpro.com> <201302151457.30892.louis.gesbert@ocamlpro.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.6 at mail X-Virus-Status: Clean Subject: Re: [Caml-list] ocp-indent 1.0.0 release On 02/17/2013 08:05 PM, Raphael Proust wrote: > On Sat, Feb 16, 2013 at 8:34 PM, Niki Yoshiuchi wrote: >> >> The second thing I've noticed is that "=" indents only relative to the >> selected text. In other words, if I have >> >> >> let my_fun f = >> . . let nested_fun g = >> . . . . (* content *) >> . . . . (* more content *) >> >> and I hit "=" while the cursor is on the third line I end up with: >> >> let my_fun f = >> . . let nested_fun g = >> (* content *) >> . . . . (* more content *) >> >> Doing something like "ggVG=" will properly indent the text. > > 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.) 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 '=' works for other languages, or without ocp-indent. Best regards, --Edwin