Browse thread
Smart caml editor and smart debugger
-
Dumitru Potop-Butucaru
- Gabriel Kerneis
- Lukasz Stafiniak
- Vincent Aravantinos
- Gaius Hammond
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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-mode-add-find-file-hook)
(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
using:
(defun camldev-insert-log-entry ()
(interactive)
(insert "(* {{{ log entry *)
if !debug_level > then (
);
(* }}} *)")
(goto-char (- (point) 20)))