Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Smart caml editor and smart debugger
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-10-15 (11:00)
From: Lukasz Stafiniak <lukstafi@g...>
Subject: Re: [Caml-list] Smart caml editor and smart debugger
On Fri, Oct 15, 2010 at 11:38 AM, Dumitru Potop-Butucaru
<> wrote:
> 1. An editor where I can collapse entire
>    definitions (by reducing a huge "let x = .... in"
>    step into a single line). I'd prefer doing it
>    using a mouse, but emacs shortcuts would
>    be OK, too.

There are several outline modes for emacs. I use folding-mode:

(folding-add-to-marks-list 'tuareg-mode "(* {{{" "(* }}}" nil t)

and at the beginning of soruce file:

(* -*- folded-file: t; -*- *)

You can see the available commands and their shortcuts in the "Fld" submenu.
I experience two annoyances (probably Tuareg is the culprit): Tuareg
indentation does not work too well around a folded section, and "goto
error" doesn't work at all (it overshots). I solve the second problem
by unfolding everything before picking an error location and then
folding back.

As for tracing, I use printfs. If something seems like a good
information to understand how the algorithm works, I leave it there

(defun camldev-insert-log-entry ()
    (insert "(* {{{ log entry *)
if !debug_level >  then (
(* }}} *)")
(goto-char (- (point) 20)))