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 5B5597F20B for ; Mon, 18 Feb 2013 00:51:21 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of aplusbi@gmail.com) identity=pra; client-ip=209.85.219.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aplusbi@gmail.com"; x-sender="aplusbi@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of aplusbi@gmail.com designates 209.85.219.47 as permitted sender) identity=mailfrom; client-ip=209.85.219.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aplusbi@gmail.com"; x-sender="aplusbi@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oa0-f47.google.com) identity=helo; client-ip=209.85.219.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aplusbi@gmail.com"; x-sender="postmaster@mail-oa0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnkBAIBsIVHRVdsvm2dsb2JhbABEhkmnZTKJHQGIH3oIFg4BAQEBAQgJCwkUJ4IfAQEEASMdARsSCwEDAQsGBQsDCg0dAgIhAQERAQUBChIGExKHbQEDCQYMoQCLY0+Ce4NGChknAwpZiHsBBQyMTYJaBAeCLYETA4hni2qBW4EdiiaDMxYphEg X-IPAS-Result: AnkBAIBsIVHRVdsvm2dsb2JhbABEhkmnZTKJHQGIH3oIFg4BAQEBAQgJCwkUJ4IfAQEEASMdARsSCwEDAQsGBQsDCg0dAgIhAQERAQUBChIGExKHbQEDCQYMoQCLY0+Ce4NGChknAwpZiHsBBQyMTYJaBAeCLYETA4hni2qBW4EdiiaDMxYphEg X-IronPort-AV: E=Sophos;i="4.84,683,1355094000"; d="scan'208";a="3261514" Received: from mail-oa0-f47.google.com ([209.85.219.47]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Feb 2013 00:51:20 +0100 Received: by mail-oa0-f47.google.com with SMTP id o17so5293311oag.6 for ; Sun, 17 Feb 2013 15:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ppbjkvLV7Wp0jh54Ao6G70NfoQHhA6uTjs7k5HJIgmY=; b=w71+AldNwl3PL2E1fJylaCSXUWnbTFGgBnM9ZFM4hPsBxy+AqtGYAXMKzWjDVzVT+I 59jKiNENl3n4HxyJraDo2xAifyy8Tm87CcBnHLMmlgsl2am1023U+lJgUJWWcg2M6eHV 1E/wvoJl0wm88+vvVhuIdc3OVmAZp2hHJ075BKVwEbA/c0xIzuRytZHhjWglSV8/E9RG HPSTypWrghldAmJ5iAST7BOCgQstNZBrV4oDjAY6L+KOKunHr/bM4YpyG7c6L+hICbGr yGBFeI5H0qDOJh7LsHzKgxl1bUU0yrFtB0vI7wmDiH81t+rLpjUTdEz7ZlUPRqz+fATL 6rWw== MIME-Version: 1.0 X-Received: by 10.182.231.39 with SMTP id td7mr5276244obc.86.1361145078869; Sun, 17 Feb 2013 15:51:18 -0800 (PST) Received: by 10.60.23.4 with HTTP; Sun, 17 Feb 2013 15:51:18 -0800 (PST) In-Reply-To: References: <201302081625.29881.louis.gesbert@ocamlpro.com> <201302151457.30892.louis.gesbert@ocamlpro.com> Date: Sun, 17 Feb 2013 18:51:18 -0500 Message-ID: From: Niki Yoshiuchi To: Raphael Proust Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=f46d04446a4be9f02304d5f448a6 Subject: Re: [Caml-list] ocp-indent 1.0.0 release --f46d04446a4be9f02304d5f448a6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for the clarification! I might spend some time working on changing the behavior in vim (particularly for indenting single lines) if other people are also interested. On Sun, Feb 17, 2013 at 1:05 PM, Raphael Proust wrote: > On Sat, Feb 16, 2013 at 8:34 PM, Niki Yoshiuchi wrote: > > I've started using this with vim and I've noticed a few things. I'm not > > sure if it's by design or if they are bugs. > > > > First, I have vim setup to use 4 spaces for indentation. When editing = an > > OCaml file, it continues to respect the 4 space indent while writing > code. > > In other words, while writing code I'll end up with something like this > > (dots represent spaces): > > > > let my_fun f =3D > > . . . . let nested_fun g =3D > > . . . . . . . . (* content *) > > > > However if I then select the text and and hit "=3D" it re-indents it us= ing > two > > spaces per nesting level. > > This is not a bug in either vim nor ocp-indent. It is a bug in your > configurations (they are not in sync). You can either setup ocp-indent > to use 4 spaces or vim to use 2. See `ocp-indent --config help` for > the former, and `:h tabstop` and `:h softtabstop` for the latter. > > > > > The second thing I've noticed is that "=3D" indents only relative to the > > selected text. In other words, if I have > > > > > > let my_fun f =3D > > . . let nested_fun g =3D > > . . . . (* content *) > > . . . . (* more content *) > > > > and I hit "=3D" while the cursor is on the third line I end up with: > > > > let my_fun f =3D > > . . let nested_fun g =3D > > (* content *) > > . . . . (* more content *) > > > > Doing something like "ggVG=3D" 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.) > > You can pass a full paragraph using `=3Dap` ("ap" stands for "a > paragraph", see `:h ap` for help). You can also use blocks. For more > information on these, see `:h text-objects`. > > Note that you can do `gg=3DG` (move, action, move) instead of `ggvG=3D` > (move, mode, move, action). It is only marginally shorter but, more > importantly, it will preserve your `'<` and `'>` marks (see, `:h '>` > for more explanations). (And dually, you can replace `=3Dap` (action, > object) by `vap=3D` (mode, object, action).) > > > > > Thanks for the great work on making OCaml more usable! My code has nev= er > > looked cleaner. > > > > -Niki Yoshiuchi > > > > > > On Fri, Feb 15, 2013 at 8:57 AM, Louis Gesbert < > louis.gesbert@ocamlpro.com> > > wrote: > >> > >> Thanks for all the feedback and few bug reports during the past week = of > >> beta- > >> test. > >> > >> We can now announce the 1.0.0 release of ocp-indent, available on opam. > >> > >> Enjoy! > >> > >> -- > >> Louis, OCamlPro > >> > >> Le vendredi 8 f=C3=A9vrier 2013 16:25:29, Louis Gesbert a =C3=A9crit : > >> > OCamlPro is proud to announce the beta-release of ocp-indent. > >> > > >> > 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. > >> > > >> > You can try it now with: > >> > > >> > $ opam install ocp-indent > >> > > >> > $ INSTDIR=3D"$(opam config var prefix)/share/typerex/ocp-indent" > >> > > >> > $ echo '(load-file "'"$INSTDIR/ocp-indent.el"'")' >>~/.emacs > >> > > >> > $ echo 'autocmd FileType ocaml source '"$INSTDIR"'/ocp-indent.vim' > >> > >>~/.vimrc > >> > > >> > > >> > Or check it out at https://github.com/OCamlPro/ocp-indent > >> > > >> > > >> > > >> > 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. > >> > > >> > Feel free to submit any code snippet that is not indented to your > taste, > >> > to > >> > help us improve ocp-indent further. > >> > > >> > > >> > 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 > >> > > >> > > >> > -- > >> > Louis Gesbert, OCamlPro > >> > >> -- > >> Caml-list mailing list. Subscription management and archives: > >> https://sympa.inria.fr/sympa/arc/caml-list > >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > >> Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > > > -- > ______________ > Rapha=C3=ABl Proust > --f46d04446a4be9f02304d5f448a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for the clarification!

I might spend some time working on cha= nging the behavior in vim (particularly for indenting single lines) if othe= r people are also interested.

On Sun, Feb= 17, 2013 at 1:05 PM, Raphael Proust <raphlalou@gmail.com>= wrote:
On Sat, Feb 16, 2013 at 8:= 34 PM, Niki Yoshiuchi <aplusbi@gmai= l.com> wrote:
> I've started using this with vim and I've noticed a few things= . =C2=A0I'm not
> sure if it's by design or if they are bugs.
>
> First, I have vim setup to use 4 spaces for indentation. =C2=A0When ed= iting an
> OCaml file, it continues to respect the 4 space indent while writing c= ode.
> In other words, while writing code I'll end up with something like= this
> (dots represent spaces):
>
> let my_fun f =3D
> . . . . let nested_fun g =3D
> . . . . . . . . (* content *)
>
> However if I then select the text and and hit "=3D" it re-in= dents it using two
> spaces per nesting level.

This is not a bug in either vim nor ocp-indent. It is a bug in your configurations (they are not in sync). You can either setup ocp-indent
to use 4 spaces or vim to use 2. See `ocp-indent --config help` for
the former, and `:h tabstop` and `:h softtabstop` for the latter.

>
> The second thing I've noticed is that "=3D" indents only= relative to the
> selected text. =C2=A0In other words, if I have
>
>
> let my_fun f =3D
> . . let nested_fun g =3D
> . . . . (* content *)
> . . . . (* more content *)
>
> and I hit "=3D" while the cursor is on the third line I end = up with:
>
> let my_fun f =3D
> . . let nested_fun g =3D
> (* content *)
> . . . . (* more content *)
>
> Doing something like "ggVG=3D" 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.)

You can pass a full paragraph using `=3Dap` ("ap" stands for &quo= t;a
paragraph", see `:h ap` for help). You can also use blocks. For more information on these, see `:h text-objects`.

Note that you can do `gg=3DG` (move, action, move) instead of `ggvG=3D`
(move, mode, move, action). It is only marginally shorter but, more
importantly, it will preserve your `'<` and `'>` marks (see, = `:h '>`
for more explanations). (And dually, you can replace `=3Dap` (action,
object) by `vap=3D` (mode, object, action).)

>
> Thanks for the great work on making OCaml more usable! =C2=A0My code h= as never
> looked cleaner.
>
> -Niki Yoshiuchi
>
>
> On Fri, Feb 15, 2013 at 8:57 AM, Louis Gesbert <louis.gesbert@ocamlpro.com>
> wrote:
>>
>> Thanks for all the feedback and few bug reports during the past = =C2=A0week of
>> beta-
>> test.
>>
>> We can now announce the 1.0.0 release of ocp-indent, available on = opam.
>>
>> Enjoy!
>>
>> --
>> Louis, OCamlPro
>>
>> Le vendredi 8 f=C3=A9vrier 2013 16:25:29, Louis Gesbert a =C3=A9cr= it :
>> > OCamlPro is proud to announce the beta-release of ocp-indent.=
>> >
>> > 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.
>> >
>> > You can try it now with:
>> >
>> > $ opam install ocp-indent
>> >
>> > $ INSTDIR=3D"$(opam config var prefix)/share/typerex/ocp= -indent"
>> >
>> > $ echo '(load-file "'"$INSTDIR/ocp-indent.e= l"'")' >>~/.emacs
>> >
>> > $ echo 'autocmd FileType ocaml source '"$INSTDIR= "'/ocp-indent.vim'
>> > >>~/.vimrc
>> >
>> >
>> > Or check it out at https://github.com/OCamlPro/ocp-indent
>> >
>> >
>> >
>> > It presents many improvements over the tuareg indentation eng= ine, a much
>> > better understanding of the syntax, linear complexity, specif= ic handling
>> > for many cases. Also, it was intentionally provided with much= less
>> > customisation options.
>> >
>> > Feel free to submit any code snippet that is not indented to = your taste,
>> > to
>> > help us improve ocp-indent further.
>> >
>> >
>> > Some comparison with tuareg on a few big OCaml projects can b= e seen at
>> > http://htmlpreview.github.com/?https:/= /github.com/AltGr/ocp-indent-
>> > tests/blob/master/status.html
>> >
>> >
>> > --
>> > Louis Gesbert, OCamlPro
>>
>> --
>> Caml-list mailing list. =C2=A0Subscription management and archives= :
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginner= s
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>



--
______________
Rapha=C3=ABl Proust

--f46d04446a4be9f02304d5f448a6--