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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 33404BBBB for ; Tue, 21 Feb 2006 01:56:29 +0100 (CET) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.197]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k1L0uSrr007567 for ; Tue, 21 Feb 2006 01:56:28 +0100 Received: by nproxy.gmail.com with SMTP id h2so661767nfe for ; Mon, 20 Feb 2006 16:56:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UHqC4VLOLjVgKa8nPOg+0LF9GboKgizxj20sX+3EkMVXgHxuD3P6JCpi08Z5dGFIID+ycMvzGnzBmZBdlvAMDETc8trLZdjfr+hESFdHrrzKbTxWLFuVoUd8dvxkT3RP8ZiMWXOdoX10VVjRx7PjQbc7oWkY6wYp1cbtUbCQhKQ= Received: by 10.48.240.15 with SMTP id n15mr694618nfh; Mon, 20 Feb 2006 16:56:28 -0800 (PST) Received: by 10.48.4.15 with HTTP; Mon, 20 Feb 2006 16:56:28 -0800 (PST) Message-ID: <9d3ec8300602201656m2e81bf82xf16a0298c2e744ac@mail.gmail.com> Date: Tue, 21 Feb 2006 01:56:28 +0100 From: "Till Varoquaux" To: "Mike Lin" Subject: Re: [Caml-list] ocaml+twt v0.81 Cc: caml-list@yquem.inria.fr In-Reply-To: <2a1a1a0c0602182220r71236921q5245e21812bffc75@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2a1a1a0c0602182220r71236921q5245e21812bffc75@mail.gmail.com> X-Miltered: at nez-perce with ID 43FA653C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 behaves:01 tuareg:01 setq:01 setq:01 ocaml:01 cheers:01 caml:02 caml:02 blank:97 blank:97 python:02 let:03 indentation:04 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Thank you for this great utility! I'd like to know what emac configuration users have. Hopefully we can work towards a good sample file which could be included in the distribution. Currently I use: ;;behaves like vim's autoindent (defun caml+twt-calculate-indentation () (save-excursion (beginning-of-line) (if (bobp) =09 ;;If this is the first line then it should be set to 0 =09 0 (forward-line -1) =09 ;;Begin navigating to find the first previous non blank line... (while (and (not (bobp)) (looking-at "[:blank:]*\n")) =09 (forward-line -1)) (current-indentation) ) )) ;;Ripped of python.el hopefully we will be able to circle through tab indentation ;;level someday (defun caml+twt-indent-line () (let ((target (caml+twt-calculate-indentation)) =09(pos (- (point-max) (point)))) (if (=3D target (current-indentation)) =09(if (< (current-column) (current-indentation)) =09 (back-to-indentation)) (beginning-of-line) (delete-horizontal-space) (indent-to target) (if (> (- (point-max) pos) (point)) =09 (goto-char (- (point-max) pos)))))) (define-derived-mode caml+twt-mode tuareg-mode "tuareg twt mode" (setq indent-line-function 'caml+twt-indent-line) (setq indent-tabs-mode 'nil) ) ;;(autoload 'caml+twt-mode "caml+twt" "Major mode for editing Ocaml+twt cod= e" t) (add-to-list 'auto-mode-alist '("\\.twt" . caml+twt-mode)) Cheers, Till Varoquaux P.S.: please be tolerant these are my first elisp lines ever...