From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 623E0BB91 for ; Sun, 2 Jan 2005 16:44:51 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j02FioCq022572 for ; Sun, 2 Jan 2005 16:44:51 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA28427 for ; Sun, 2 Jan 2005 16:44:50 +0100 (MET) Received: from spoolo3.tiscali.be (spoolo3.tiscali.be [62.235.13.169]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j02Fio8e022569 for ; Sun, 2 Jan 2005 16:44:50 +0100 Received: from [62.235.156.22] (helo=poincare) by spoolo3.tiscali.be with esmtp (Tiscali.be http://www.tiscali.be) id 1Cl7uO-0001ac-Da; Sun, 02 Jan 2005 16:44:45 +0100 Received: from poincare ([127.0.0.1] helo=localhost ident=trch) by poincare with esmtp (Exim 3.36 #1 (Debian)) id 1Cl7uN-0003RT-00; Sun, 02 Jan 2005 16:44:43 +0100 Date: Sun, 02 Jan 2005 16:44:42 +0100 (CET) Message-Id: <20050102.164442.74087888.Christophe.Troestler@umh.ac.be> To: "O'Caml Mailing List" Subject: Re: tuareg-mode v.s. caml-mode (was: Wishes for an easy install of Ocaml) From: Christophe TROESTLER In-Reply-To: <20050102.102149.112764189.garrigue@math.nagoya-u.ac.jp> References: <20041227165411.GA3342@pegasos> <20041231162037.GA11346@furbychan.cocan.org> <20050102.102149.112764189.garrigue@math.nagoya-u.ac.jp> Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Spook: USCOI cryptanalysis ASDIC Qaddafi diwn Panama Agfa BROMURE benelux Craig Livingstone X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.1.53 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41D816F3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41D816F2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-mode:01 ocaml:01 christophe:01 troestler:01 christophe:01 troestler:01 umh:01 wrote:01 tuareg:01 tuareg:01 caml-mode:01 mli:01 mll:01 emacs:01 params:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Sun, 02 Jan 2005, Jacques Garrigue wrote: > > Having never tried Tuareg (mostly out of inertia, since I'm > satisfied with the core mode), could you be more precise about what > is better in Tuareg. For me essentially - font-lock - more customizable Caml-mode font-lock is not bad but it has some shortcomings and is difficult to tailor to one likes [1] -- as far as I know (please, correct me if I am wrong), one cannot change the font-lock colors on a per-mode basis. Granted, this is a convenience issue but when you get used to comfort... On the other hand, the caml-mode has also strong points: it has the ability to display the "definitions" in the speedbar -- at least if you add (speedbar-add-supported-extension '(".ml" ".mli" ".mll" ".mly")) in ~/.emacs -- and tuareg currently does not. :( > Ditching the core mode would indeed save time for some people. Note that tuareg uses some files of the caml-mode. What about some collaboration to merge the better of the two modes into a unique one?? > (But note that in order to replace the core mode, you have to be > able to indent in exactly the same way.) I do not know all params of the core mode but here is my config and it is pretty close: (setq tuareg-in-indent 0) (setq tuareg-let-always-indent t) (setq tuareg-let-indent 2) (setq tuareg-with-indent 0) (setq tuareg-function-indent 0) (setq tuareg-fun-indent 0) (setq tuareg-parser-indent 0) (setq tuareg-match-indent 0) (setq tuareg-begin-indent 2) (setq tuareg-parse-indent 2); .mll (setq tuareg-rule-indent 2) Here is an example where it is not exactly the same but tuareg mode behavior seems more reasonable to me: caml-mode: Hashtbl.iter (fun id buf -> output_string fcgi_stdout fd id (Buffer.contents buf); Buffer.clear buf ) outputs_stdout; tuareg-mode: Hashtbl.iter (fun id buf -> output_string fcgi_stdout fd id (Buffer.contents buf); Buffer.clear buf ) outputs_stdout; Happy new year, ChriS --- [1] Some examples to give you an idea: - [data: string] and [data : string] get highlighted differently (yes, there is only a non-significant space difference); - "|" and "->" are set to font-lock-constant-face (too bright for me) but I cannot change their colors without affecting other symbols and other modes. Moreover in "[|" both or none should be highlighted. - Constructors get the font-lock-function-name-face (which I would do without personally) but the real functions [let f x =...] do not. Tuareg is much better at highlighting functions and variables. - The main thing that bother me basically is that the faces are not set in a way that reflects their semantic : for example * [open] is colored with font-lock-variable-name-face (sic), * [raise] is with font-lock-comment-face, * [for] and [if] are keywords and should be treated as such! * font-lock-doccomment-face should be replaced with font-lock-doc-face and so caml-mode colors do not have the same meaning as in other buffers... - Here is a doc comment not which is not highlighted: (** [decode_range s low up] decodes the substring [s.[low .. up-1]] i.e., in the returned string the '%XX' and '+' are converted into their chars. The range [s.[low .. up-1]] is overwritten. It returns the decoded string. [decode_range_strip] does the same, except that the decoded strings are stripped of heading and trailing spaces. It is ASSUMED that the range is valid i.e., [0 <= low] and [up <= String.length s]. Invalid '%XX' are left unchanged. *) - Here is a normal comment which is not highlighted: (* File: cgi_common.ml This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details; it is available at , or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)