Version française
Home     About     Download     Resources     Contact us    
Browse thread
ANNOUNCE: LablGtkSourceView
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefano Zacchiroli <zack@b...>
Subject: Re: [Caml-list] ANNOUNCE: LablGtkSourceView
On Fri, Jul 08, 2005 at 04:42:17PM +0200, David Baelde wrote:
> Many people probably want to know: is there a OCaml.lang for
> specifying OCaml syntax/indentation for GtkSourceView ? Could be
> useful for that ongoing OCamlIDE project...

I'm not aware of such a .lang and at the moment I'm not interested in
writing it. That said, writing a .lang is relatively easy and there are
a lot of examples in gedit (the more widespread application which uses
GtkSourceView), also monodevelop uses it and probably has an archive of
.lang files but I've never looked at them.

> But I haven't found anything about auto-indent customization. Is it
> possible ?

GtkSourceView support auto-indent and in LablGtkSourceView you can
enable it either from the constructor (?auto_indent param) or with
set_auto_indent. However the supported form of automatic indentation is
more limited than those found in emacs or vim. GtkSourceView indeed
support only indentation preservation (i.e. when starting a new line
copy the amount of indent of the last one).

On top of that implementing automatic indentation similar to vim's
smartindent (i.e. augment the indentation if last line ends with a word
in a given set, e.g. "then", "do", ...) should be relatively easy and I
plan to do it in next releases of LablGtkSourceView.

Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-