English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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
<dumitru.potop_butucaru@inria.fr> 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)))