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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9C2CBBB84 for ; Wed, 17 May 2006 11:12:10 +0200 (CEST) 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 k4H9CAka027343 for ; Wed, 17 May 2006 11:12:10 +0200 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 LAA11750 for ; Wed, 17 May 2006 11:12:09 +0200 (MET DST) Received: from triton.rz.uni-saarland.de (triton.rz.uni-saarland.de [134.96.7.25]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4H9C9w9027336 for ; Wed, 17 May 2006 11:12:09 +0200 Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by triton.rz.uni-saarland.de (8.12.11.20060308/8.12.10) with ESMTP id k4H9C8ru14447605 for ; Wed, 17 May 2006 11:12:08 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by uni-sb.de (8.13.6/2006032300) with ESMTP id k4H9C5Le029599 for ; Wed, 17 May 2006 11:12:08 +0200 (CEST) Received: from mail.st.cs.uni-sb.de (goscinny.cs.uni-sb.de [134.96.235.32]) by mail.cs.uni-sb.de (8.13.6/2006032300) with ESMTP id k4H9C2kK004495 for ; Wed, 17 May 2006 11:12:05 +0200 (CEST) Received: from [134.96.235.101] (jonagold.cs.uni-sb.de [134.96.235.101]) by mail.st.cs.uni-sb.de (Postfix) with ESMTP id 29C591BD76 for ; Wed, 17 May 2006 11:12:02 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v623) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: Caml List From: Christian Lindig Subject: Announce: annot looks up types in *.annot files Date: Wed, 17 May 2006 11:12:01 +0200 X-Mailer: Apple Mail (2.623) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (triton.rz.uni-saarland.de [134.96.7.25]); Wed, 17 May 2006 11:12:08 +0200 (CEST) X-AntiVirus: checked by AntiVir Milter (version: 1.1.1-9; AVE: 6.34.1.29; VDF: 6.34.1.94; host: AntiVir2) X-Miltered: at concorde with ID 446AE8EA.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 446AE8E9.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lindig:01 lindig:01 vim:01 ocaml:01 annotation:01 trivial:01 vim:01 emacs:01 bsd-style:01 unix:01 uni-sb:01 uni-sb:01 implemented:02 string:02 types:02 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=none autolearn=disabled version=3.0.3 To lookup types of identifiers from within Vim, I have implemented a small tool in Ocaml called annot: $ annot -type 30 20 main.annot string list Given a cursor position (line 30, column 20) it looks up the type annotation for that position in main.annot. It is trivial to hook this to a key in Vim, and probably most other editors. function! OCamlType() let col = col('.') let line = line('.') let file = expand("%:p:r") echo system("annot -n -type " . line . " " . col . " " . file . ".annot") endfunction map ,t :call OCamlType() I'm well aware that Vim and Emacs have their own solutions, using their own scripting languages, but I think it is better to have one general solution. You can download the tool from my subversion repository; it is released under a BSD-style license. svn co svn://svn.vistabella.de/annot The tool should build on Unix systems, comes with ./configure, and a manual page. Let me know if there are any problems. Of course, positive feedback is also welcome. -- Christian -- http://www.st.cs.uni-sb.de/~lindig/