From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id A9A5BBBAF for ; Fri, 15 Oct 2010 13:00:03 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcBAA/Rt0zRVdg2kGdsb2JhbACTJo1zCBUBAQEBCQkMBxEDH6FeiUyCGYY/LohWAQEDBYVEBIpK X-IronPort-AV: E=Sophos;i="4.57,335,1283724000"; d="scan'208";a="61447082" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Oct 2010 13:00:03 +0200 Received: by qwe4 with SMTP id 4so425264qwe.27 for ; Fri, 15 Oct 2010 04:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=3Io2jw01kruwgg4eOzMPptcBmxmhBiSENAQxY2QApoE=; b=Q5rlSyet1yecUJxQDAq4s/9tsrCDHOJwSpmCKBPW9to/K2C9cnVDiAqqcyGtcRyZGM BmDZvpsIgc+mJSI3DTJgsOfSAReGfDFponeo720SbPghQNMt8ThhBKamrz6bWw2X6LXw npVJVaZdewLNkn/Ffu2EUFHWS90rBhjmw/Os4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=YPNNc5KvJwJFl8JgXmq098ReYF8esAGljkhew0AXFyJr49HHvADefHDYL7luDyZI3Z eoXBE1kchP1nO+R8UKgp3vU8d7oEv1rBbW9nEzTlomDZjShqMzIajeBFRI/AN/chz8PW ZEgsDDUjo6CO583Zkoi+nruLvtxR4QWhPimbg= Received: by 10.229.91.9 with SMTP id k9mr549242qcm.248.1287140402289; Fri, 15 Oct 2010 04:00:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.182.19 with HTTP; Fri, 15 Oct 2010 03:59:42 -0700 (PDT) In-Reply-To: <4CB8210D.7030307@inria.fr> References: <4CB8210D.7030307@inria.fr> From: Lukasz Stafiniak Date: Fri, 15 Oct 2010 12:59:42 +0200 Message-ID: Subject: Re: [Caml-list] Smart caml editor and smart debugger To: dumitru.potop@inria.fr Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; lukasz:01 debugger:01 emacs:01 emacs:01 tuareg:01 tuareg:01 collapse:98 wrote:01 tracing:01 caml-list:01 algorithm:01 caml:02 seems:03 let:03 indentation:04 On Fri, Oct 15, 2010 at 11:38 AM, Dumitru Potop-Butucaru wrote: > > 1. An editor where I can collapse entire > =A0 =A0definitions (by reducing a huge "let x =3D .... in" > =A0 =A0step into a single line). I'd prefer doing it > =A0 =A0using a mouse, but emacs shortcuts would > =A0 =A0be 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)))