caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Baelde <david.baelde@ens-lyon.fr>
To: caml-list@inria.fr
Cc: Olivier Grisel <olivier.grisel@ensta.org>
Subject: Re: [Caml-list] New Ocaml indentation for VIm
Date: Fri, 25 Feb 2005 19:55:42 +0100	[thread overview]
Message-ID: <421F74AE.40604@ens-lyon.fr> (raw)
In-Reply-To: <421EFC68.6060002@ensta.org>

[-- Attachment #1: Type: text/plain, Size: 2052 bytes --]


Olivier Grisel wrote:
> I have just tried it for a few seconds and I found the following 
> identation a bit too wide:
> 
> let f = function
>           |  [] -> foo
>           | x::l -> bar

That was a known issue, I had a (not so visible) page on my website 
about that. It was the "relative vs. incremental dilemn"... With a naive 
implementation, I couldn't base the indentation of line 2 on the 
beginning of line 1, so I based it on the keyword "function". Here is an 
idea of what you get if you base the indentation on the beginning of the 
line of the base keyword, without taking care:

let _ =
   something first_arg second_one (if a then
     foo bar
   else
     bar foo)

This week I was away from the network, but kept coding a bit... I tried 
to figure out what tuareg does (cannot read that amount of elisp), and 
did the same in OMLet. I will release it soon on vim.org. I also added 
customization. The current implementation base the indentation on the 
beginning of the line, or the last "(", "[" or "{" before the keyword, 
on the same line, if there's one. As far as I've tried, it's a good trick.

The 4 spaces proposed by S. Luther a nice compromise between the strict 
old indentation and the tricky and meaningless (but nice) new 
indentation. But I think it would require more work for me, and for the 
script, which is already so slow... And I don't think people want it so 
much.

Regarding integration of omlet with the official ocaml support, as far 
as I'm concerned I think it could be done within a few months, when 
OMLet will be considered stable. But Markus Mottl didn't give me his 
advice. There's only a very minor issue about code annotations, because 
I don't like being warned that my VIm is not compiled with python 
support everytime I open a OCaml file, and I'd like to find a good 
solution without Python. Also, I didn't work at all on .mll and .mly 
support.

Packaging omlet separately is OK. Samuel Mimram could do that. I would 
just suggest to wait a bit.

Hope you'll like release 0.7!
--
David

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  parent reply	other threads:[~2005-02-25 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-06  2:31 David Baelde
2005-02-25 10:22 ` [Caml-list] " Olivier Grisel
2005-02-25 10:58   ` Sven Luther
2005-02-25 14:18     ` Olivier Grisel
2005-02-25 18:55   ` David Baelde [this message]
2005-02-26  8:16     ` Stefano Zacchiroli
2005-02-26  8:39       ` Sven Luther
2005-02-26  9:51         ` Samuel Mimram
2005-02-26 10:48           ` Sven Luther
2005-03-07 15:57     ` Markus Mottl
2005-03-23 22:37       ` Olivier Grisel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421F74AE.40604@ens-lyon.fr \
    --to=david.baelde@ens-lyon.fr \
    --cc=caml-list@inria.fr \
    --cc=david.baelde@ens-lyon.org \
    --cc=olivier.grisel@ensta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).