caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@mail4.ai.univie.ac.at>
To: Jeremy Fincher <tweedgeezer@hotmail.com>
Cc: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] Vim6 and O'Caml.
Date: Sat, 6 Oct 2001 12:53:00 +0200	[thread overview]
Message-ID: <20011006125300.A6453@fichte.ai.univie.ac.at> (raw)
In-Reply-To: <F114eDuHdkrW3WU1kdV00013ceb@hotmail.com>; from tweedgeezer@hotmail.com on Sat, Oct 06, 2001 at 01:52:30 -0400

On Sat, 06 Oct 2001, Jeremy Fincher wrote:
> I've tried the new vim6 indent files, but it doesn't seem to apply
> the same rules that emacs applies, which I'm both accustomed to, and
> which almost all the source code I've seen is writte in.

It actually isn't capable of correctly indenting OCaml-code. The reason
is simple: you'd need a complete parser and pretty-printer to do so. This
is an awful lot of work and slows down some operations considerably.

Currently, the indent file for OCaml does an approximate job: it
only considers the current and the last line to compute a suitable
shiftwidth. This works remarkably well in the majority of cases.

> Surely all the source code I've seen written hasn't been written
> in emacs, so I assume there's some way to make vim indent code like
> emacs does.  Does anyone know how to do so?

You can also program Vim (though not in Lisp). Considering the richness
of builtin functions in Emacs and the still large amount of Lisp-code
required to implement automatic indentation (~ 1500 LOCS), I wouldn't
dare to do the same for Vim. Anybody want to give it a go? ;)

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      parent reply	other threads:[~2001-10-06 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-06  5:52 Jeremy Fincher
2001-10-06  8:21 ` Stefano Zacchiroli
2001-10-06 10:53 ` Markus Mottl [this message]

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=20011006125300.A6453@fichte.ai.univie.ac.at \
    --to=markus@mail4.ai.univie.ac.at \
    --cc=caml-list@pauillac.inria.fr \
    --cc=tweedgeezer@hotmail.com \
    /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).