Commits

R Primus  committed c549ec1

add caml and tuareg packages

  • Participants
  • Parent commits 8d984bf

Comments (0)

Files changed (20)

File .emacs.d/abbrev_defs

+;;-*-coding: utf-8;-*-
+(define-abbrev-table 'Buffer-menu-mode-abbrev-table '())
+
+(define-abbrev-table 'change-log-mode-abbrev-table '())
+
+(define-abbrev-table 'comint-mode-abbrev-table '())
+
+(define-abbrev-table 'completion-list-mode-abbrev-table '())
+
+(define-abbrev-table 'display-time-world-mode-abbrev-table '())
+
+(define-abbrev-table 'dsssl-mode-abbrev-table '())
+
+(define-abbrev-table 'emacs-lisp-mode-abbrev-table '())
+
+(define-abbrev-table 'erl-who-calls-mode-abbrev-table '())
+
+(define-abbrev-table 'eshell-mode-abbrev-table '())
+
+(define-abbrev-table 'fundamental-mode-abbrev-table '())
+
+(define-abbrev-table 'global-abbrev-table '())
+
+(define-abbrev-table 'grep-mode-abbrev-table '())
+
+(define-abbrev-table 'helm-grep-mode-abbrev-table '())
+
+(define-abbrev-table 'help-mode-abbrev-table '())
+
+(define-abbrev-table 'image-dired-display-image-mode-abbrev-table '())
+
+(define-abbrev-table 'image-dired-thumbnail-mode-abbrev-table '())
+
+(define-abbrev-table 'inferior-python-mode-abbrev-table '())
+
+(define-abbrev-table 'inferior-scheme-mode-abbrev-table '())
+
+(define-abbrev-table 'lisp-mode-abbrev-table '())
+
+(define-abbrev-table 'occur-edit-mode-abbrev-table '())
+
+(define-abbrev-table 'occur-mode-abbrev-table '())
+
+(define-abbrev-table 'package-menu-mode-abbrev-table '())
+
+(define-abbrev-table 'process-menu-mode-abbrev-table '())
+
+(define-abbrev-table 'prog-mode-abbrev-table '())
+
+(define-abbrev-table 'python-mode-abbrev-table
+  '(
+   ))
+
+(define-abbrev-table 'reb-lisp-mode-abbrev-table '())
+
+(define-abbrev-table 'reb-mode-abbrev-table '())
+
+(define-abbrev-table 'ruby-mode-abbrev-table '())
+
+(define-abbrev-table 'scheme-mode-abbrev-table '())
+
+(define-abbrev-table 'select-tags-table-mode-abbrev-table '())
+
+(define-abbrev-table 'shell-mode-abbrev-table '())
+
+(define-abbrev-table 'sldb-mode-abbrev-table '())
+
+(define-abbrev-table 'slime-connection-list-mode-abbrev-table '())
+
+(define-abbrev-table 'slime-fuzzy-completions-mode-abbrev-table '())
+
+(define-abbrev-table 'slime-inspector-mode-abbrev-table '())
+
+(define-abbrev-table 'slime-thread-control-mode-abbrev-table '())
+
+(define-abbrev-table 'slime-xref-mode-abbrev-table '())
+
+(define-abbrev-table 'snippet-mode-abbrev-table '())
+
+(define-abbrev-table 'special-mode-abbrev-table '())
+
+(define-abbrev-table 'tabulated-list-mode-abbrev-table '())
+
+(define-abbrev-table 'tar-mode-abbrev-table '())
+
+(define-abbrev-table 'text-mode-abbrev-table '())
+
+(define-abbrev-table 'vc-git-log-view-mode-abbrev-table '())
+

File .emacs.d/elpa/caml-20121015.1250/caml-autoloads.el

+;;; caml-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+
+;;;### (autoloads (camldebug) "camldebug" "camldebug.el" (20672 45166))
+;;; Generated autoloads from camldebug.el
+
+(defvar camldebug-command-name "ocamldebug" "\
+*Pathname for executing camldebug.")
+
+(autoload 'camldebug "camldebug" "\
+Run camldebug on program FILE in buffer *camldebug-FILE*.
+The directory containing FILE becomes the initial working directory
+and source-file directory for camldebug.  If you wish to change this, use
+the camldebug commands `cd DIR' and `directory'.
+
+\(fn PATH)" t nil)
+
+;;;***
+
+;;;### (autoloads nil nil ("caml-compat.el" "caml-emacs.el" "caml-font-old.el"
+;;;;;;  "caml-font.el" "caml-help.el" "caml-hilit.el" "caml-pkg.el"
+;;;;;;  "caml-types.el" "caml-xemacs.el" "caml.el" "inf-caml.el")
+;;;;;;  (20672 45166 722587))
+
+;;;***
+
+(provide 'caml-autoloads)
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; caml-autoloads.el ends here

File .emacs.d/elpa/caml-20121015.1250/caml-compat.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*           Xavier Leroy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;; function definitions for old versions of emacs
+
+;; indent-line-to
+
+(if (not (fboundp 'indent-line-to))
+    (defun indent-line-to (column)
+      "Indent current line to COLUMN.
+
+This function removes or adds spaces and tabs at beginning of line
+only if necessary.  It leaves point at end of indentation."
+      (if (= (current-indentation) column)
+          (back-to-indentation)
+        (beginning-of-line 1)
+        (delete-horizontal-space)
+        (indent-to column))))
+
+;; buffer-substring-no-properties
+
+(cond
+ ((fboundp 'buffer-substring-no-properties))
+ ((fboundp 'buffer-substring-without-properties)
+  (defalias 'buffer-substring-no-properties
+    'buffer-substring-without-properties))
+ (t
+  (defalias 'buffer-substring-no-properties 'buffer-substring)))
+
+(provide 'caml-compat)

File .emacs.d/elpa/caml-20121015.1250/caml-emacs.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*            Didier Remy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;; for caml-help.el
+(defalias 'caml-info-other-window 'info-other-window)
+
+;; for caml-types.el
+
+(defalias 'caml-line-beginning-position 'line-beginning-position)
+
+(defalias 'caml-read-event 'read-event)
+(defalias 'caml-window-edges 'window-edges)
+(defun caml-mouse-vertical-position ()
+  (cddr (mouse-position)))
+(defalias 'caml-ignore-event-p 'integer-or-marker-p)
+(defalias 'caml-mouse-movement-p 'mouse-movement-p)
+(defalias 'caml-sit-for 'sit-for)
+
+(defmacro caml-track-mouse (&rest body) (cons 'track-mouse body))
+
+(defun caml-event-window (e) (posn-window (event-start e)))
+(defun caml-event-point-start (e) (posn-point (event-start e)))
+(defun caml-event-point-end (e) (posn-point (event-end e)))
+
+(defun caml-release-event-p (original event)
+  (and (equal (event-basic-type original) (event-basic-type event))
+       (let ((modifiers  (event-modifiers event)))
+         (or (member 'drag modifiers)
+             (member 'click modifiers)))))
+
+(if (fboundp 'string-to-number)
+   (defalias 'caml-string-to-int 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-int))
+
+(provide 'caml-emacs)

File .emacs.d/elpa/caml-20121015.1250/caml-font-old.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;; useful colors
+
+(cond
+ ((x-display-color-p)
+  (require 'font-lock)
+  (cond
+   ((not (boundp 'font-lock-type-face))
+    ; make the necessary faces
+    (make-face 'Firebrick)
+    (set-face-foreground 'Firebrick "Firebrick")
+    (make-face 'RosyBrown)
+    (set-face-foreground 'RosyBrown "RosyBrown")
+    (make-face 'Purple)
+    (set-face-foreground 'Purple "Purple")
+    (make-face 'MidnightBlue)
+    (set-face-foreground 'MidnightBlue "MidnightBlue")
+    (make-face 'DarkGoldenRod)
+    (set-face-foreground 'DarkGoldenRod "DarkGoldenRod")
+    (make-face 'DarkOliveGreen)
+    (set-face-foreground 'DarkOliveGreen "DarkOliveGreen4")
+    (make-face 'CadetBlue)
+    (set-face-foreground 'CadetBlue "CadetBlue")
+    ; assign them as standard faces
+    (setq font-lock-comment-face 'Firebrick)
+    (setq font-lock-string-face 'RosyBrown)
+    (setq font-lock-keyword-face 'Purple)
+    (setq font-lock-function-name-face 'MidnightBlue)
+    (setq font-lock-variable-name-face 'DarkGoldenRod)
+    (setq font-lock-type-face 'DarkOliveGreen)
+    (setq font-lock-reference-face 'CadetBlue)))
+  ; extra faces for documention
+  (make-face 'Stop)
+  (set-face-foreground 'Stop "White")
+  (set-face-background 'Stop "Red")
+  (make-face 'Doc)
+  (set-face-foreground 'Doc "Red")
+  (setq font-lock-stop-face 'Stop)
+  (setq font-lock-doccomment-face 'Doc)
+))
+
+; The same definition is in caml.el:
+; we don't know in which order they will be loaded.
+(defvar caml-quote-char "'"
+  "*Quote for character constants. \"'\" for OCaml, \"`\" for Caml-Light.")
+
+(defconst caml-font-lock-keywords
+  (list
+;stop special comments
+   '("\\(^\\|[^\"]\\)\\((\\*\\*/\\*\\*)\\)"
+     2 font-lock-stop-face)
+;doccomments
+   '("\\(^\\|[^\"]\\)\\((\\*\\*[^*]*\\([^)*][^*]*\\*+\\)*)\\)"
+     2 font-lock-doccomment-face)
+;comments
+   '("\\(^\\|[^\"]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)"
+     2 font-lock-comment-face)
+;character literals
+   (cons (concat caml-quote-char "\\(\\\\\\([ntbr" caml-quote-char "\\]\\|"
+                 "[0-9][0-9][0-9]\\)\\|.\\)" caml-quote-char
+                 "\\|\"[^\"\\]*\\(\\\\\\(.\\|\n\\)[^\"\\]*\\)*\"")
+         'font-lock-string-face)
+;modules and constructors
+   '("`?\\<[A-Z][A-Za-z0-9_']*\\>" . font-lock-function-name-face)
+;definition
+   (cons (concat
+          "\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
+          "\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
+          "\\|in\\(herit\\|itializer\\)?\\|let"
+          "\\|m\\(ethod\\|utable\\|odule\\)"
+          "\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
+          "\\|v\\(al\\|irtual\\)\\)\\>")
+         'font-lock-type-face)
+;blocking
+   '("\\<\\(begin\\|end\\|object\\|s\\(ig\\|truct\\)\\)\\>"
+     . font-lock-keyword-face)
+;control
+   (cons (concat
+          "\\<\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|i\\(f\\|gnore\\)"
+          "\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)"
+          "\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\>"
+          "\\|\|\\|->\\|&\\|#")
+         'font-lock-reference-face)
+   '("\\<raise\\>" . font-lock-comment-face)
+;labels (and open)
+   '("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]" 1
+     font-lock-variable-name-face)
+   '("\\<\\(assert\\|open\\|include\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
+     . font-lock-variable-name-face)))
+
+(defconst inferior-caml-font-lock-keywords
+  (append
+   (list
+;inferior
+    '("^[#-]" . font-lock-comment-face))
+   caml-font-lock-keywords))
+
+;; font-lock commands are similar for caml-mode and inferior-caml-mode
+(defun caml-mode-font-hook ()
+  (cond
+   ((fboundp 'global-font-lock-mode)
+    (make-local-variable 'font-lock-defaults)
+    (setq font-lock-defaults
+          '(caml-font-lock-keywords nil nil ((?' . "w") (?_ . "w")))))
+   (t
+    (setq font-lock-keywords caml-font-lock-keywords)))
+  (make-local-variable 'font-lock-keywords-only)
+  (setq font-lock-keywords-only t)
+  (font-lock-mode 1))
+
+(add-hook 'caml-mode-hook 'caml-mode-font-hook)
+
+(defun inferior-caml-mode-font-hook ()
+  (cond
+   ((fboundp 'global-font-lock-mode)
+    (make-local-variable 'font-lock-defaults)
+    (setq font-lock-defaults
+          '(inferior-caml-font-lock-keywords
+            nil nil ((?' . "w") (?_ . "w")))))
+   (t
+    (setq font-lock-keywords inferior-caml-font-lock-keywords)))
+  (make-local-variable 'font-lock-keywords-only)
+  (setq font-lock-keywords-only t)
+  (font-lock-mode 1))
+
+(add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-font-hook)
+
+(provide 'caml-font)

File .emacs.d/elpa/caml-20121015.1250/caml-font.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*         Jacques Garrigue, Ian T Zimmerman, Damien Doligez           *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;; caml-font: font-lock support for OCaml files
+;; now with perfect parsing of comments and strings
+
+(require 'font-lock)
+
+(defvar caml-font-stop-face
+  (progn
+    (make-face 'caml-font-stop-face)
+    (set-face-foreground 'caml-font-stop-face "White")
+    (set-face-background 'caml-font-stop-face "Red")
+    'caml-font-stop-face))
+
+(defvar caml-font-doccomment-face
+  (progn
+    (make-face 'caml-font-doccomment-face)
+    (set-face-foreground 'caml-font-doccomment-face "Red")
+    'caml-font-doccomment-face))
+
+(unless (facep 'font-lock-preprocessor-face)
+  (defvar font-lock-preprocessor-face
+    (copy-face 'font-lock-builtin-face
+               'font-lock-preprocessor-face)))
+
+(defconst caml-font-lock-keywords
+  `(
+;modules and constructors
+   ("`?\\<[A-Z][A-Za-z0-9_']*\\>" . font-lock-function-name-face)
+;definition
+   (,(regexp-opt '("and" "as" "constraint" "class"
+                   "exception" "external" "fun" "function" "functor"
+                   "in" "inherit" "initializer" "let"
+                   "method" "mutable" "module" "of" "private" "rec"
+                   "type" "val" "virtual")
+                 'words)
+    . font-lock-type-face)
+;blocking
+   (,(regexp-opt '("begin" "end" "object" "sig" "struct") 'words)
+    . font-lock-keyword-face)
+;linenums
+   ("# *[0-9]+" . font-lock-preprocessor-face)
+;infix operators
+   (,(regexp-opt '("asr" "land" "lor" "lsl" "lsr" "lxor" "mod") 'words)
+    . font-lock-builtin-face)
+;control
+   (,(concat "[|#&]\\|->\\|"
+             (regexp-opt '("do" "done" "downto" "else" "for" "if" "ignore"
+                           "lazy" "match" "new" "or" "then" "to" "try"
+                           "when" "while" "with")
+                         'words))
+    . font-lock-constant-face)
+   ("\\<raise\\|failwith\\|invalid_arg\\>"
+    . font-lock-comment-face)
+;labels (and open)
+   ("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]"
+    1 font-lock-variable-name-face)
+   ("\\<\\(assert\\|open\\|include\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
+    . font-lock-variable-name-face)))
+
+
+(defun caml-font-syntactic-face (s)
+  (let ((in-string  (nth 3 s))
+        (in-comment (nth 4 s))
+        (start      (nth 8 s)))
+    (cond
+     (in-string 'font-lock-string-face)
+     (in-comment
+      (save-excursion
+        (goto-char start)
+        (cond
+         ((looking-at "(\\*\\*/\\*\\*)") 'caml-font-stop-face)
+         ((looking-at "(\\*\\*[^*]")     'caml-font-doccomment-face)
+         (t                              'font-lock-comment-face)))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; In order to correctly fontify an OCaml buffer, it is necessary to
+; lex the buffer to tell what is a comment and what is a string.
+; We do this incrementally in a hook
+; (font-lock-extend-after-change-region-function), which is called
+; whenever the buffer changes.  It sets the syntax-table property
+; on each beginning and end of chars, strings, and comments.
+
+; This mode handles correctly all the strange cases in the following
+; OCaml code.
+;
+; let l' _ = ();;
+; let _' _ = ();;
+; let l' = ();;
+; let b2_' = ();;
+; let a'a' = ();;
+; let f2 _ _ = ();;
+; let f3 _ _ _ = ();;
+; let f' _ _ _ _ _ = ();;
+; let hello = ();;
+;
+; (* ==== easy stuff ==== *)
+;
+; (* a comment *)
+; (* "a string" in a comment *)
+; (* "another string *)" in a comment *)
+; (* not a string '"' in a comment *)
+; "a string";;
+; '"';;              (* not a string *)
+;
+; (* ==== hard stuff ==== *)
+;
+; l'"' not not a string ";;
+; _'"' also not not a string";;
+; f2 0l'"';;            (* not not not a string *)
+; f2 0_'"';;            (* also not not not a string *)
+; f3 0.0l'"' not not not not a string ";;
+; f3 0.0_'"';;          (* not not not not not a string *)
+; f2 0b01_'"';;         (* not not not a string *)
+; f3 0b2_'"'  not not not not a string ";;
+; f3 0b02_'"';;         (* not not not not not a string *)
+; '\'';;   (* a char *)
+; '
+; ';;      (* a char *)
+; '^M
+; ';;      (* also a char [replace ^M with one CR character] *)
+; a'a';;   (* not a char *)
+; type '
+; a' t = X;;   (* also not a char *)
+;
+; (* ==== far-out stuff ==== *)
+;
+;    f'"'" "*) print_endline "hello";;(* \"" ;;
+; (* f'"'" "*) print_endline "hello";;(* \"" ;; *)
+
+
+(defconst caml-font-ident-re
+  "[A-Za-z_\300-\326\330-\366\370-\377][A-Za-z_\300-\326\330-\366\370-\377'0-9]*"
+)
+
+(defconst caml-font-int-re
+  "\\(0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\\|0[oO][0-7][0-7_]*\\|0[bB][01][01_]*\\)[lLn]?"
+)
+
+; decimal integers are folded into the RE for floats to get longest-match
+; without using posix-looking-at
+(defconst caml-font-decimal-re
+  "[0-9][0-9_]*\\([lLn]\\|\\.[0-9_]*\\)?\\([eE][+-]?[0-9][0-9_]*\\)?"
+)
+
+; match any ident or numeral token
+(defconst caml-font-ident-or-num-re
+  (concat caml-font-ident-re "\\|" caml-font-int-re "\\|" caml-font-decimal-re)
+)
+
+; match any char token
+(defconst caml-font-char-re
+  "'\\(\015\012\\|[^\\']\\|\\(\\\\\\([\\'\"ntbr ]\\|[0-9][0-9][0-9]\\|x[0-9A-Fa-f][0-9A-Fa-f]\\)\\)\\)'"
+)
+
+; match a quote followed by a newline
+(defconst caml-font-quote-newline-re
+  "'\\(\015\012\\|[\012\015]\\)"
+)
+
+; match any token or sequence of tokens that cannot contain a
+; quote, double quote, a start of comment, or a newline
+; note: this is only to go faster than one character at a time
+(defconst caml-font-other-re
+  "[^A-Za-z_0-9\012\015\300-\326\330-\366\370-\377'\"(]+"
+)
+
+; match any sequence of non-special characters in a comment
+; note: this is only to go faster than one character at a time
+(defconst caml-font-other-comment-re
+  "[^(*\"'\012\015]+"
+)
+
+; match any sequence of non-special characters in a string
+; note: this is only to go faster than one character at a time
+(defconst caml-font-other-string-re
+  "[^\\\"\012\015]"
+)
+
+; match a newline
+(defconst caml-font-newline-re
+  "\\(\015\012\\|[\012\015]\\)"
+)
+
+; Put the 'caml-font-state property with the given state on the
+; character before pos.  Return nil if it was already there, t if not.
+(defun caml-font-put-state (pos state)
+  (if (equal state (get-text-property (1- pos) 'caml-font-state))
+      nil
+    (put-text-property (1- pos) pos 'caml-font-state state)
+    t)
+)
+
+; Same as looking-at, but erase properties 'caml-font-state and
+; 'syntax-table from the matched range
+(defun caml-font-looking-at (re)
+  (let ((result (looking-at re)))
+    (when result
+      (remove-text-properties (match-beginning 0) (match-end 0)
+                              '(syntax-table nil caml-font-state nil)))
+    result)
+)
+
+; Annotate the buffer starting at point in state (st . depth)
+; Set the 'syntax-table property on beginnings and ends of:
+; - strings
+; - chars
+; - comments
+; Also set the 'caml-font-state property on each LF character that is
+; not preceded by a single quote. The property gives the state of the
+; lexer (nil or t) after reading that character.
+
+; Leave the point at a point where the pre-existing 'caml-font-state
+; property is consistent with the new parse, or at the end of the buffer.
+
+; depth is the depth of nested comments at this point
+;   it must be a non-negative integer
+; st can be:
+;   nil  -- we are in the base state
+;   t    -- we are within a string
+
+(defun caml-font-annotate (st depth)
+  (let ((continue t))
+    (while (and continue (not (eobp)))
+      (cond
+       ((and (equal st nil) (= depth 0)) ; base state, outside comment
+        (cond
+         ((caml-font-looking-at caml-font-ident-or-num-re)
+          (goto-char (match-end 0)))
+         ((caml-font-looking-at caml-font-char-re)
+          (put-text-property (point) (1+ (point))
+                             'syntax-table (string-to-syntax "|"))
+          (put-text-property (1- (match-end 0)) (match-end 0)
+                             'syntax-table (string-to-syntax "|"))
+          (goto-char (match-end 0)))
+         ((caml-font-looking-at caml-font-quote-newline-re)
+          (goto-char (match-end 0)))
+         ((caml-font-looking-at "\"")
+          (put-text-property (point) (1+ (point))
+                             'syntax-table (string-to-syntax "|"))
+          (goto-char (match-end 0))
+          (setq st t))
+         ((caml-font-looking-at "(\\*")
+          (put-text-property (point) (1+ (point))
+                             'syntax-table (string-to-syntax "!"))
+          (goto-char (match-end 0))
+          (setq depth 1))
+         ((looking-at caml-font-newline-re)
+          (goto-char (match-end 0))
+          (setq continue (caml-font-put-state (match-end 0) '(nil . 0))))
+         ((caml-font-looking-at caml-font-other-re)
+          (goto-char (match-end 0)))
+         (t
+          (remove-text-properties (point) (1+ (point))
+                                  '(syntax-table nil caml-font-state nil))
+          (goto-char (1+ (point))))))
+       ((equal st nil)                 ; base state inside comment
+        (cond
+         ((caml-font-looking-at "(\\*")
+          (goto-char (match-end 0))
+          (setq depth (1+ depth)))
+         ((caml-font-looking-at "\\*)")
+          (goto-char (match-end 0))
+          (setq depth (1- depth))
+          (when (= depth 0)
+            (put-text-property (1- (point)) (point)
+                               'syntax-table (string-to-syntax "!"))))
+         ((caml-font-looking-at "\"")
+          (goto-char (match-end 0))
+          (setq st t))
+         ((caml-font-looking-at caml-font-char-re)
+          (goto-char (match-end 0)))
+         ((caml-font-looking-at caml-font-quote-newline-re)
+          (goto-char (match-end 0)))
+         ((caml-font-looking-at "''")
+          (goto-char (match-end 0)))
+         ((looking-at caml-font-newline-re)
+          (goto-char (match-end 0))
+          (setq continue (caml-font-put-state (match-end 0) (cons nil depth))))
+         ((caml-font-looking-at caml-font-other-comment-re)
+          (goto-char (match-end 0)))
+         (t
+          (remove-text-properties (point) (1+ (point))
+                                  '(syntax-table nil caml-font-state nil))
+          (goto-char (1+ (point))))))
+       (t                     ; string state inside or outside a comment
+        (cond
+         ((caml-font-looking-at "\"")
+          (when (= depth 0)
+            (put-text-property (point) (1+ (point))
+                               'syntax-table (string-to-syntax "|")))
+          (goto-char (1+ (point)))
+          (setq st nil))
+         ((caml-font-looking-at "\\\\[\"\\]")
+          (goto-char (match-end 0)))
+         ((looking-at caml-font-newline-re)
+          (goto-char (match-end 0))
+          (setq continue (caml-font-put-state (match-end 0) (cons t depth))))
+         ((caml-font-looking-at caml-font-other-string-re)
+          (goto-char (match-end 0)))
+         (t
+          (remove-text-properties (point) (1+ (point))
+                                  '(syntax-table nil caml-font-state nil))
+          (goto-char (1+ (point)))))))))
+)
+
+; This is the hook function for font-lock-extend-after-change-function
+; It finds the nearest saved state at the left of the changed text,
+; calls caml-font-annotate to set the 'caml-font-state and 'syntax-table
+; properties, then returns the range that was parsed by caml-font-annotate.
+(defun caml-font-extend-after-change (beg end &optional old-len)
+  (save-excursion
+    (save-match-data
+      (let ((caml-font-modified (buffer-modified-p))
+            start-at
+            end-at
+            state)
+        (remove-text-properties beg end '(syntax-table nil caml-font-state nil))
+        (setq start-at
+              (or (and (> beg (point-min))
+                       (get-text-property (1- beg) 'caml-font-state)
+                       beg)
+                  (previous-single-property-change beg 'caml-font-state)
+                  (point-min)))
+        (setq state (or (and (> start-at (point-min))
+                             (get-text-property (1- start-at) 'caml-font-state))
+                        (cons nil 0)))
+        (goto-char start-at)
+        (caml-font-annotate (car state) (cdr state))
+        (setq end-at (point))
+        (restore-buffer-modified-p caml-font-modified)
+        (cons start-at end-at))))
+)
+
+; We don't use the normal caml-mode syntax table because it contains an
+; approximation of strings and comments that interferes with our
+; annotations.
+(defconst caml-font-syntax-table
+  (let ((tbl (make-syntax-table)))
+    (modify-syntax-entry ?' "w" tbl)
+    (modify-syntax-entry ?_ "w" tbl)
+    (modify-syntax-entry ?\" "." tbl)
+    (let ((i 192))
+      (while (< i 256)
+        (or (= i 215) (= i 247) (modify-syntax-entry i "w" tbl))
+        (setq i (1+ i))))
+    tbl))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; font-lock commands are similar for caml-mode and inferior-caml-mode
+(defun caml-font-set-font-lock ()
+  (setq parse-sexp-lookup-properties t)
+  (setq font-lock-defaults
+        (list
+         'caml-font-lock-keywords  ; keywords
+         nil  ; keywords-only
+         nil  ; case-fold
+         nil  ; syntax-alist
+         nil  ; syntax-begin
+         (cons 'font-lock-syntax-table caml-font-syntax-table)
+         '(font-lock-extend-after-change-region-function
+           . caml-font-extend-after-change)
+         '(font-lock-syntactic-face-function . caml-font-syntactic-face)
+         ))
+  (caml-font-extend-after-change (point-min) (point-max) 0)
+  (font-lock-mode 1)
+)
+(add-hook 'caml-mode-hook 'caml-font-set-font-lock)
+
+
+
+(defconst inferior-caml-font-lock-keywords
+  `(("^[#-]" . font-lock-comment-face)
+    ,@caml-font-lock-keywords))
+
+(defun inferior-caml-set-font-lock ()
+  (setq parse-sexp-lookup-properties t)
+  (setq font-lock-defaults
+        (list
+         'inferior-caml-font-lock-keywords  ; keywords
+         nil  ; keywords-only
+         nil  ; case-fold
+         nil  ; syntax-alist
+         nil  ; syntax-begin
+         (cons 'font-lock-syntax-table caml-font-syntax-table)
+         '(font-lock-extend-after-change-region-function
+           . caml-font-extend-after-change)
+         '(font-lock-syntactic-face-function . caml-font-syntactic-face)
+         ))
+  (caml-font-extend-after-change (point-min) (point-max) 0)
+  (font-lock-mode 1)
+)
+(add-hook 'inferior-caml-mode-hooks 'inferior-caml-set-font-lock)
+
+(provide 'caml-font)

File .emacs.d/elpa/caml-20121015.1250/caml-help.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*            Didier Remy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 2001 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;; caml-info.el --- contextual completion and help to caml-mode
+
+;; Didier Remy, November 2001.
+
+;; This provides two functions completion and help
+;; look for caml-complete and caml-help
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;  This is a preliminary version.
+;;
+;;  Possible improvements?
+;;   - dump some databaes: Info, Lib, ...
+;;   - accept a search path for local libraries instead of current dir
+;;     (then distinguish between different modules lying in different
+;;     directories)
+;;   - improve the construction for info files.
+;;
+;;  Abstract over
+;;   - the viewing method and the database, so that the documentation for
+;;     and identifier could be search in
+;;       * info / html / man / mli's sources
+;;       * viewed in emacs or using an external previewer.
+;;
+;;  Take all identifiers (labels, Constructors, exceptions, etc.)
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(eval-and-compile
+  (if (and (boundp 'running-xemacs) running-xemacs)
+      (require 'caml-xemacs)
+    (require 'caml-emacs)))
+
+;; Loading or building databases.
+;;
+
+;; variables to be customized
+
+(defvar ocaml-lib-path 'lazy
+  "Path list for ocaml lib sources (mli files)
+
+'lazy means ask ocaml to find it for your at first use.")
+(defun ocaml-lib-path ()
+  "Computes if necessary and returns the path for ocaml libs"
+  (if (listp ocaml-lib-path) nil
+    (setq ocaml-lib-path
+          (split-string
+           (shell-command-to-string
+            (or
+             (and (boundp 'inferior-caml-program)
+                      (string-match "\\([^ ]*/ocaml\\)\\( \\|$\\)"
+                       inferior-caml-program)
+                      (let ((file
+                             (concat (match-string 1 inferior-caml-program)
+                                     "c")))
+                        (and (file-executable-p file)
+                             (concat file " -where"))))
+             "ocamlc -where")))))
+    ocaml-lib-path)
+
+
+
+;; General purpose auxiliary functions
+
+(defun ocaml-capitalize (s)
+  (concat (capitalize (substring s 0 1)) (substring s 1)))
+
+(defun ocaml-uncapitalize (s)
+  (if (> (length s) 0)
+      (concat (downcase (substring s 0 1)) (substring s 1))
+    s))
+
+(defun iter (f l) (while (consp l) (apply f (list (car l))) (setq l (cdr l))))
+
+(defun ocaml-find-files (path filter &optional depth split)
+  (let* ((path-string
+          (if (stringp path)
+              (if (file-directory-p path) path nil)
+            (mapconcat '(lambda (d) (if (file-directory-p d) d))
+                       path " ")))
+         (command
+          (and path-string
+               (concat "find " path-string
+                       " '(' " filter " ')' "
+                       (if depth (concat " -maxdepth " (int-to-string depth)))
+                       (if split nil " -printf '%\p '")
+                       )))
+          (files
+           (and command (shell-command-to-string command))))
+         (if (and split (stringp files)) (split-string files "\n") files)
+         ))
+
+;; Specialized auxiliary functions
+
+
+;; Global table of modules contents of modules loaded lazily.
+
+(defvar ocaml-module-alist 'lazy
+  "A-list of modules with how and where to find help information.
+  'delay means non computed yet")
+
+(defun ocaml-add-mli-modules (modules tag &optional path)
+  (let ((files
+         (ocaml-find-files (or path (ocaml-lib-path))
+                           "-type f -name '*.mli'" 1 t)))
+    (while (consp files)
+      (if (string-match "\\([^/]*\\).mli" (car files))
+          (let* ((module (ocaml-capitalize (match-string 1 (car files))))
+                 (dir (file-name-directory (car files)))
+                 (dirp (member dir (ocaml-lib-path))))
+            (if (and (consp dirp) (string-equal dir (car dirp)))
+                (setq dir (car dirp)))
+            (if (assoc module modules) nil
+              (setq modules
+                    (cons (cons module (cons (cons tag dir) 'lazy)) modules))
+              )))
+      (setq files (cdr files)))
+    modules))
+
+(defun ocaml-add-path (dir &optional path)
+  "Extend  ocaml-module-alist with modules of DIR relative to PATH"
+  (interactive "D")
+  (let* ((old (ocaml-lib-path))
+         (new
+          (if (file-name-absolute-p dir) dir
+            (concat
+             (or (find-if '(lambda (p) (file-directory-p (concat p  "/" dir)))
+                      (cons default-directory old))
+                 (error "Directory not found"))
+             "/" dir))))
+    (setq ocaml-lib-path (cons (car old) (cons new (cdr old))))
+    (setq ocaml-module-alist
+          (ocaml-add-mli-modules (ocaml-module-alist) 'lib new))))
+
+(defun ocaml-module-alist ()
+  "Call by need value of variable ocaml-module-alist"
+  (if (listp ocaml-module-alist)
+      nil
+    ;; build list of mli files
+    (setq ocaml-module-alist (ocaml-add-mli-modules nil 'lib))
+    ;; dumping information ? TODO
+    )
+  ocaml-module-alist)
+
+(defun ocaml-get-or-make-module (module &optional tag)
+  (let ((info (assoc module (ocaml-module-alist))))
+    (if info nil
+      (setq info (cons module (cons (cons 'local default-directory) 'lazy)))
+      (setq ocaml-module-alist (cons info ocaml-module-alist))
+      )
+    info))
+
+;; Symbols of module are lazily computed
+
+(defun ocaml-module-filename (module)
+  (let ((module (ocaml-uncapitalize module)) (name))
+    (if (file-exists-p (setq name (concat module ".mli"))) nil
+      (let ((tmp (ocaml-lib-path)))
+        (while (consp tmp)
+          (setq name (concat (car tmp) "/" module ".mli"))
+          (if (file-exists-p name) (setq tmp nil)
+            (setq name nil)))))
+    name))
+
+(defun ocaml-module-symbols (module-info)
+  (let* ((module (car module-info))
+         (tail (and module-info (cdr module-info)))
+         (tag (caar tail))
+         (dir (cdar tail))
+         (file)
+         (alist))
+    (if (listp (cdr tail))
+        (cdr tail)
+      (if (equal tag 'info)
+          (setq dir (car ocaml-lib-path)) ; XXX to be fixed
+        )
+      (setq file (concat dir "/" (ocaml-uncapitalize module) ".mli"))
+      (message file)
+      (save-window-excursion
+        (set-buffer (get-buffer-create "*caml-help*"))
+        (if (and file (file-exists-p file))
+            (progn
+              (message "Scanning module %s" file)
+              (insert-file-contents file))
+          (message "Module %s not found" module))
+        (while (re-search-forward
+                "\\([ \t]*val\\|let\\|exception\\|external\\|  [|]\\) \\([a-zA-Z_0-9'][a-zA-Z_0-9']*\\)\\|^  *[{]* \\([a-z_][A-Za-z_0-9]*\\) : [^;\n][^;\n]*;"
+                (point-max) 'move)
+          (pop-to-buffer (current-buffer))
+          (setq alist (cons (or (match-string 2) (match-string 3)) alist)))
+        (erase-buffer)
+        )
+      (setcdr tail alist)
+      alist)
+      ))
+
+;; Local list of visible modules.
+
+(defvar ocaml-visible-modules 'lazy
+  "A-list of open modules, local to every file.")
+(make-variable-buffer-local 'ocaml-visible-modules)
+(defun ocaml-visible-modules ()
+  (if (listp ocaml-visible-modules) nil
+    (progn
+      (setq ocaml-visible-modules
+            (list (ocaml-get-or-make-module "Pervasives")))
+      (save-excursion
+        (goto-char (point-min))
+        (while (re-search-forward "^ *open  *\\([A-Z][a-zA-Z'_0-9]*\\)"
+                                  (point-max) t)
+          (let ((module (match-string 1)))
+            (if (assoc module ocaml-visible-modules) nil
+              (setq ocaml-visible-modules
+                    (cons (ocaml-get-or-make-module module)
+                          ocaml-visible-modules)))))
+        )))
+  ocaml-visible-modules)
+
+(defun ocaml-open-module (arg)
+  "*Make module of name ARG visible whe ARG is a string.
+When call interactively, make completion over known modules."
+  (interactive "P")
+  (if (not (stringp arg))
+      (let ((modules (ocaml-module-alist)))
+        (setq arg
+              (completing-read "Open module: " modules))))
+  (if (and (stringp arg) (not (equal arg "")))
+      (progn
+        (if (assoc arg (ocaml-visible-modules))
+            (ocaml-close-module arg))
+        (setq ocaml-visible-modules
+              (cons (ocaml-get-or-make-module arg) (ocaml-visible-modules)))
+        ))
+  (message "%S" (mapcar 'car (ocaml-visible-modules))))
+
+(defun ocaml-close-module (arg)
+  "*Close module of name ARG when ARG is a string.
+When call interactively, make completion over visible modules.
+Otherwise if ARG is true, close all modules and reset to default. "
+  (interactive "P")
+  (if (= (prefix-numeric-value arg) 4)
+      (setq ocaml-visible-modules 'lazy)
+    (let* ((modules (ocaml-visible-modules)))
+      (if (null modules) (error "No visible module to close"))
+      (unless (stringp arg)
+        (setq arg
+              (completing-read
+               (concat "Close module ["  (caar modules) "] : ")
+               modules))
+        (if (equal arg "") (setq arg (caar modules))))
+      (setq ocaml-visible-modules
+            (remove-if '(lambda (m) (equal (car m) arg))
+                       ocaml-visible-modules))
+      ))
+  (message "%S" (mapcar 'car (ocaml-visible-modules))))
+
+
+;; Look for identifiers around point
+
+(defun ocaml-qualified-identifier (&optional show)
+  "Search for a qualified identifier (Path. entry) around point.
+
+Entry may be nil.
+Currently, the path may only be nil or a single Module.
+For paths is of the form Module.Path', it returns Module
+and always nil for entry.
+
+If defined Module and Entry are represented by a region in the buffer,
+and are nil otherwise.
+
+For debugging purposes, it returns the string Module.entry if called
+with an optional non-nil argument.
+"
+  (save-excursion
+    (let ((module) (entry))
+      (if (looking-at "[ \n]") (skip-chars-backward " "))
+      (if (re-search-backward
+           "\\([^A-Za-z0-9_.']\\|\\`\\)\\([A-Za-z0-9_']*[.]\\)*[A-Za-z0-9_']*\\="
+           (- (point) 100) t)
+          (progn
+            (or (looking-at "\\`[A-Za-z)-9_.]") (forward-char 1))
+            (if (looking-at "\\<\\([A-Za-z_][A-Za-z0-9_']*\\)[.]")
+                (progn
+                  (setq module (cons (match-beginning 1) (match-end 1)))
+                  (goto-char (match-end 0))))
+            (if (looking-at "\\<\\([A-Za-z_][A-Za-z0-9_']*\\)\\>")
+                (setq entry (cons (match-beginning 1) (match-end 1))))))
+      (if show
+          (concat
+           (and module (buffer-substring (car module) (cdr module)))
+           "."
+           (and entry (buffer-substring (car entry) (cdr entry))))
+      (cons module entry))
+    )))
+
+;; completion around point
+
+(defun ocaml-completion (pattern module)
+  (let ((list
+         (or
+          (and module
+               (list
+                (or (assoc module (ocaml-module-alist))
+                    (error "Unknown module %s" module))))
+          (ocaml-visible-modules))))
+    (message "Completion from %s" (mapconcat 'car list " "))
+    (if (null pattern)
+        (apply 'append (mapcar 'ocaml-module-symbols list))
+      (let ((pat (concat "^" (regexp-quote pattern))) (res))
+        (iter
+         '(lambda (l)
+            (iter '(lambda (x)
+                     (if (string-match pat (car l))
+                         (if (member x res) nil (setq res (cons x res)))))
+                  (ocaml-module-symbols l)))
+         list)
+        res)
+      )))
+
+(defun caml-complete (arg)
+  "Does completion for OCaml identifiers qualified.
+
+It attemps to recognize an qualified identifier Module . entry
+around point using function \\[ocaml-qualified-identifier].
+
+If Module is defined, it does completion for identifier in Module.
+
+If Module is undefined, it does completion in visible modules.
+Then, if completion fails, it does completion among  all modules
+where identifier is defined."
+  (interactive "p")
+  (let* ((module-entry (ocaml-qualified-identifier)) (entry)
+         (module)
+         (beg) (end) (pattern))
+    (if (car module-entry)
+        (progn
+          (setq module
+                (buffer-substring (caar module-entry) (cdar module-entry)))
+          (or (assoc module (ocaml-module-alist))
+              (and (setq module
+                         (completing-read "Module: " (ocaml-module-alist)
+                                          nil nil module))
+                   (save-excursion
+                     (goto-char (caar module-entry))
+                     (delete-region (caar module-entry) (cdar module-entry))
+                     (insert module) t)
+                   (setq module-entry (ocaml-qualified-identifier))
+                   (car module-entry)
+                   (progn (setq entry (cdr module-entry)) t))
+              (error "Unknown module %s" module))))
+    (if (consp (cdr module-entry))
+        (progn
+          (setq beg (cadr module-entry))
+          (setq end (cddr module-entry)))
+      (if (and module
+           (save-excursion
+            (goto-char (cdar module-entry))
+            (looking-at " *[.]")))
+          (progn
+            (setq beg (match-end 0))
+            (setq end beg))))
+    (if (not (and beg end))
+        (error "Did not find anything to complete around point")
+
+      (setq pattern (buffer-substring beg end))
+      (let* ((all-completions (ocaml-completion pattern module))
+             (completion
+              (try-completion pattern (mapcar 'list all-completions))))
+        (cond ((eq completion t))
+
+              ((null completion)
+               (let*
+                   ((modules (ocaml-find-module pattern))
+                    (visible (intersection modules (ocaml-visible-modules)))
+                    (hist)
+                    (module
+                     (cond
+                      ((null modules)
+                       nil)
+                      ((equal (length modules) 1)
+                       (caar modules))
+                      ((equal (length visible) 1)
+                       (caar visible))
+                      (t
+                       (setq hist (mapcar 'car modules))
+                       (completing-read "Module: " modules nil t
+                                        "" (cons hist 0)))
+                      )))
+                 (if (null module)
+                     (error "Can't find completion for \"%s\"" pattern)
+                   (message "Completion found in module %s" module)
+                   (if (and (consp module-entry) (consp (cdr module-entry)))
+                       (delete-region (caar module-entry) end)
+                     (delete-region beg end))
+                   (insert module "." pattern))))
+
+              ((not (string-equal pattern completion))
+               (delete-region beg end)
+               (goto-char beg)
+               (insert completion))
+
+              (t
+                (with-output-to-temp-buffer "*Completions*"
+                  (display-completion-list all-completions))
+                ))
+               ))))
+
+
+;; Info files (only in ocamldoc style)
+
+
+(defvar ocaml-info-prefix "ocaml-lib"
+  "Prefix of ocaml info files describing library modules.
+Suffix .info will be added to info files.
+Additional suffix .gz may be added if info files are compressed.
+")
+;;
+
+(defun ocaml-hevea-info-add-entries (entries dir name)
+  (let*
+      ((filter
+        (concat "-type f -regex '.*/" name
+                "\\(.info\\|\\)\\(-[0-9]*\\|\\)\\([.]gz\\|\\)'"
+                ))
+       (section-regexp
+        "\\* \\(Section [1-9][0-9--]*\\)::[ \t][ \t]*Module *\\([A-Z][A-Za-z_0-9]*\\)")
+       (files (ocaml-find-files dir filter))
+       (command))
+    ;; scanning info files
+    (if (or (null files)
+            (not (stringp files))
+            (string-match files "^ *$"))
+        (message "No info file found: %s." (mapconcat 'identity files " "))
+      (message "Scanning info files %s." files)
+      (save-window-excursion
+        (set-buffer (get-buffer-create "*caml-help*"))
+        (setq command
+              (concat "zcat -f " files
+                      " | grep -e '" section-regexp "'"))
+        (message "Scanning files with: %s" command)
+        (or (shell-command command (current-buffer))
+            (error "Error while scanning"))
+        (goto-char (point-min))
+        (while (re-search-forward section-regexp (point-max) t)
+          (let* ((module (match-string 2))
+                 (section (match-string 1)))
+            ;; (message "%s %s" module section)
+            (if (assoc module entries) nil
+              (setq entries
+                    (cons (cons module (concat "(" name ")" section))
+                          entries))
+              )))
+        (let ((buf (get-buffer "*caml-help*")))
+          (if buf (kill-buffer buf)))))
+    entries))
+
+(defun ocaml-hevea-info ()
+  "The default way to create an info data base from the value
+of \\[Info-default-directory-list] and the base name \\[ocaml-info-name]
+of files to look for.
+
+This uses info files produced by HeVeA.
+"
+  (let ((collect) (seen))
+    (iter '(lambda (d)
+             (if (member d seen) nil
+               (setq collect
+                     (ocaml-hevea-info-add-entries
+                      collect d ocaml-info-prefix))
+               (setq done (cons d seen))))
+          Info-directory-list)
+    collect))
+
+(defun ocaml-ocamldoc-info-add-entries (entries dir name)
+  (let*
+      ((module-regexp "^Node: \\([A-Z][A-Za-z_0-9]*\\)[^ ]")
+       (command
+        (concat
+         "find " dir " -type f -regex '.*/" name
+         "\\(.info\\|\\)\\([.]gz\\|\\)' -print0"
+         " | xargs -0 zcat -f | grep '" module-regexp "'")))
+    (message "Scanning info files in %s" dir)
+    (save-window-excursion
+      (set-buffer (get-buffer-create "*caml-help*"))
+      (or (shell-command command (current-buffer))
+          (error "Could not run:%s" command))
+      (goto-char (point-min))
+      (while (re-search-forward module-regexp (point-max) t)
+        (if (equal (char-after (match-end 1)) 127)
+            (let* ((module (match-string 1)))
+              (if (assoc module entries) nil
+                (setq entries
+                      (cons (cons module (concat "(" name ")" module))
+                            entries))
+                ))))
+      ; (kill-buffer (current-buffer))
+      )
+    entries))
+
+(defun ocaml-ocamldoc-info ()
+  "The default way to create an info data base from the value
+of \\[Info-default-directory-list] and the base name \\[ocaml-info-name]
+of files to look for.
+
+This uses info files produced by ocamldoc."
+  (require 'info)
+  (let ((collect) (seen))
+    (iter '(lambda (d)
+             (if (member d seen) nil
+               (setq collect
+                     (ocaml-ocamldoc-info-add-entries collect d
+                                                      ocaml-info-prefix))
+               (setq done (cons d seen))))
+          Info-directory-list)
+    collect))
+
+;; Continuing
+
+(defvar ocaml-info-alist 'ocaml-ocamldoc-info
+  "A-list binding module names to info entries:
+
+  nil means do not use info.
+
+  A function to build the list lazily (at the first call). The result of
+the function call will be assign permanently to this variable for future
+uses. We provide two default functions \\[ocaml-info-default-function]
+(info produced by HeVeA is the default) and \\[ocaml-info-default-function]
+(info produced by ocamldoc).
+
+  Otherwise, this value should be an alist binding module names to info
+entries of the form to \"(entry)section\" be taken by the \\[info]
+command. An entry may be an info module or a complete file name."
+)
+
+(defun ocaml-info-alist ()
+  "Call by need value of variable ocaml-info-alist"
+  (cond
+   ((listp ocaml-info-alist))
+   ((functionp ocaml-info-alist)
+    (setq ocaml-info-alist (apply ocaml-info-alist nil)))
+   (t
+    (error "wrong type for ocaml-info-alist")))
+  ocaml-info-alist)
+
+;; help around point
+
+(defun ocaml-find-module (symbol &optional module-list)
+  (let ((list (or module-list (ocaml-module-alist)))
+        (collect))
+    (while (consp list)
+      (if (member symbol (ocaml-module-symbols (car list)))
+          (setq collect (cons (car list) collect)))
+      (setq list (cdr list)))
+    (nreverse collect)
+    ))
+
+(defun ocaml-buffer-substring (region)
+  (and region (buffer-substring-no-properties (car region) (cdr region))))
+
+;; Help function.
+
+
+(defun ocaml-goto-help (&optional module entry same-window)
+  "Searches info manual for MODULE and ENTRY in MODULE.
+If unspecified, MODULE and ENTRY are inferred from the position in the
+current buffer using \\[ocaml-qualified-identifier]."
+  (interactive)
+  (let ((window (selected-window))
+        (info-section (assoc module (ocaml-info-alist))))
+    (if info-section
+        (caml-info-other-window (cdr info-section))
+      (ocaml-visible-modules)
+      (let* ((module-info
+              (or (assoc module (ocaml-module-alist))
+                  (and (file-exists-p
+                        (concat (ocaml-uncapitalize module) ".mli"))
+                       (ocaml-get-or-make-module module))))
+             (location (cdr (cadr module-info))))
+        (cond
+         (location
+          (let ((file (concat location (ocaml-uncapitalize module) ".mli")))
+            (if (window-live-p same-window)
+                (progn (select-window same-window)
+                       (view-mode-exit view-return-to-alist view-exit-action))
+              ;; (view-buffer (find-file-noselect file) 'view))
+              )
+            (view-file-other-window file)
+            (bury-buffer (current-buffer))))
+         (info-section (error "Aborted"))
+         (t (error "No help for module %s" module))))
+      )
+    (if (stringp entry)
+        (let ((here (point))
+              (regex (regexp-quote entry))
+              (case-fold-search nil))
+          (goto-char (point-min))
+          (if (or (re-search-forward
+                   (concat "\\(val\\|exception\\|type\\|external\\|[|{;]\\) +"
+                           regex)
+                   ;; (concat "\\(val\\|exception\\|external\\) +\\("
+                   ;;         regex "\\|( *" regex " *)\\)")
+                   (point-max) t)
+                  (re-search-forward
+                   (concat "type [^{]*{[^}]*" regex " :")
+                   ;; (concat "\\(type\\|[|{;]\\) +" regex)
+                   (point-max) t)
+                  (progn
+                    (if (window-live-p window) (select-window window))
+                    (error "Entry %s not found in module %s"
+                           entry module))
+                  ;; (search-forward entry (point-max) t)
+                  )
+              (ocaml-help-show -1)
+            (progn
+              (message "Help for entry %s not found in module %s"
+                       entry module)
+              (goto-char here)))
+          ))
+    (ocaml-link-activate (cdr info-section))
+    (if (window-live-p window) (select-window window))
+    ))
+
+(defun caml-help (arg)
+  "Find documentation for OCaml qualified identifiers.
+
+It attemps to recognize an qualified identifier of the form
+``Module . entry'' around point using function `ocaml-qualified-identifier'.
+
+If Module is undetermined it is temptatively guessed from the identifier name
+and according to visible modules. If this is still unsucessful,  the user is
+then prompted for a Module name.
+
+The documentation for Module is first seach in the info manual if available,
+then in the ``module.mli'' source file. The entry is then searched in the
+documentation.
+
+Visible modules are computed only once, at the first call.
+Modules can be made visible explicitly with `ocaml-open-module' and
+hidden with `ocaml-close-module'.
+
+Prefix arg 0 forces recompilation of visible modules (and their content)
+from the file content.
+
+Prefix arg 4 prompts for Module and identifier instead of guessing values
+from the possition of point in the current buffer.
+"
+  (interactive "p")
+  (delete-overlay ocaml-help-ovl)
+  (let ((module) (entry) (module-entry))
+    (cond
+     ((= arg 4)
+      (or (and
+           (setq module
+                (completing-read "Module: " (ocaml-module-alist)
+                                 nil t "" (cons 'hist 0)))
+           (not (string-equal module "")))
+          (error "Quit"))
+      (let ((symbols
+             (mapcar 'list
+                     (ocaml-module-symbols
+                      (assoc module (ocaml-module-alist))))))
+        (setq entry
+              (completing-read (format "Value: %s." module) symbols nil t)))
+      (if (string-equal entry "") (setq entry nil))
+      )
+     (t
+      (if (= arg 0) (setq ocaml-visible-modules 'lazy))
+      (setq module-entry (ocaml-qualified-identifier))
+      (setq entry (ocaml-buffer-substring (cdr module-entry)))
+      (setq module
+            (or (ocaml-buffer-substring (car module-entry))
+                (let ((modules
+                       (or (ocaml-find-module entry (ocaml-visible-modules))
+                           (ocaml-find-module entry)))
+                      (hist) (default))
+                  (cond
+                   ((null modules)
+                    (error "No module found for entry %s" entry))
+                   ((equal (length modules) 1)
+                    (caar modules))
+                   (t
+                    (setq hist (mapcar 'car modules))
+                    (setq default (car hist))
+                    (setq module
+                          (completing-read
+                           (concat "Module: "
+                                   (and default (concat "[" default "] ")))
+                           modules nil t "" (cons 'hist 0)))
+                    (if (string-equal module "") default module))
+                   ))))
+      ))
+     (message "Help for %s%s%s" module (if entry "." "") (or entry ""))
+     (ocaml-goto-help module entry)
+     ))
+
+;; auto-links
+
+(defconst ocaml-link-regexp
+  "\\(type\\|and\\) \\('[a-z] +\\|(\\('[a-z], *\\)*'[a-z])\\|\\) *\\([a-zA-Z0-9_]*\\)\\( *$\\| =\\)")
+(defconst ocaml-longident-regexp
+  "\\([A-Z][a-zA-Z_0]*\\)[.]\\([a-zA-Z][A-Za-z0-9_]*\\)")
+
+(defvar ocaml-links nil
+  "Local links in the current of last info node or interface file.
+
+The car of the list is a key that indentifies the module to prevent
+recompilation when next help command is relative to the same module.
+The cdr is a list of elments, each of which is an string and a pair of
+buffer positions."
+)
+(make-variable-buffer-local 'ocaml-links)
+
+(defun ocaml-info-links (section)
+  (cdr
+   (if (and ocaml-links section (equal (car ocaml-links) section))
+       ocaml-links
+     (save-excursion
+       (goto-char (point-min))
+       (let ((regexp (concat (if (equal major-mode 'Info-mode) "^ - " "^")
+                             ocaml-link-regexp))
+             (all))
+         (while (re-search-forward regexp (point-max) t)
+           (setq all
+                 (cons (cons (match-string 4)
+                             (cons (match-beginning 4)
+                                   (match-end 4)))
+                       all)))
+         (setq ocaml-links (cons section all))
+         )))))
+
+(defvar ocaml-link-map (make-sparse-keymap))
+(define-key ocaml-link-map [mouse-2] 'ocaml-link-goto)
+
+(defvar ocaml-help-ovl (make-overlay 1 1))
+(make-face 'ocaml-help-face)
+(set-face-doc-string 'ocaml-help-face
+                     "face for hilighting expressions and types")
+(if (not (face-differs-from-default-p 'ocaml-help-face))
+    (set-face-background 'ocaml-help-face "#88FF44"))
+(overlay-put ocaml-help-ovl 'face 'ocaml-help-face)
+
+(defun ocaml-help-show (arg)
+  (let ((right (point))
+        (left (progn (forward-word arg) (point))))
+    (goto-char right)
+    (move-overlay ocaml-help-ovl left right (current-buffer))
+    (recenter 1)
+    ))
+
+(defun ocaml-link-goto (click)
+  (interactive "e")
+  (let* ((pos (caml-event-point-start click))
+         (win (caml-event-window click))
+         (buf (window-buffer win))
+         (window (selected-window))
+         (link))
+    (setq link
+          (with-current-buffer buf
+            (buffer-substring
+             (previous-single-property-change (+ pos 1) 'local-map
+                                                   buf (- pos 100))
+             (next-single-property-change pos  'local-map
+                                        buf (+ pos 100)))))
+    (if (string-match (concat "^" ocaml-longident-regexp "$") link)
+        (ocaml-goto-help (match-string 1 link) (match-string 2 link) win)
+      (if (not (equal (window-buffer window) buf))
+          (switch-to-buffer-other-window buf))
+      (if (setq link (assoc link (cdr ocaml-links)))
+          (progn
+            (goto-char (cadr link))
+            (ocaml-help-show 1)))
+      (if (window-live-p window) (select-window window))
+      )))
+
+(cond
+ ((and (x-display-color-p)
+       (not (memq 'ocaml-link-face (face-list))))
+  (make-face 'ocaml-link-face)
+  (set-face-foreground 'ocaml-link-face "Purple")))
+
+
+(defun ocaml-link-activate (section)
+  (let ((links (ocaml-info-links section)))
+    (if links
+        (let ((regexp (concat "[^A-Za-z0-9'_]\\("
+                              ocaml-longident-regexp "\\|"
+                              (mapconcat 'car links "\\|")
+                              "\\)[^A-Za-z0-9'_]"))
+              (case-fold-search nil))
+          (save-excursion
+            (goto-char (point-min))
+            (let ((buffer-read-only nil)
+                  ;; use of dynamic scoping, need not be restored!
+                  (modified-p (buffer-modified-p)))
+              (unwind-protect
+                  (save-excursion
+                    (goto-char (point-min))
+                    (while (re-search-forward regexp (point-max) t)
+                      (put-text-property (match-beginning 1) (match-end 1)
+                                         'mouse-face 'highlight)
+                      (put-text-property (match-beginning 1) (match-end 1)
+                                         'local-map ocaml-link-map)
+                      (if (x-display-color-p)
+                          (put-text-property (match-beginning 1) (match-end 1)
+                                             'face 'ocaml-link-face)))
+                    )
+                ;; need to restore flag if buffer was unmodified.
+                (unless modified-p (set-buffer-modified-p nil))
+                ))
+            )))))
+
+
+
+;; bindings ---now in caml.el
+
+; (and
+;  (boundp 'caml-mode-map)
+;  (keymapp caml-mode-map)
+;  (progn
+;    (define-key caml-mode-map [?\C-c?i] 'ocaml-add-path)
+;    (define-key caml-mode-map [?\C-c?]] 'ocaml-close-module)
+;    (define-key caml-mode-map [?\C-c?[] 'ocaml-open-module)
+;    (define-key caml-mode-map [?\C-c?\C-h] 'caml-help)
+;    (define-key caml-mode-map [?\C-c?\t] 'caml-complete)
+;    (let ((map (lookup-key caml-mode-map [menu-bar caml])))
+;      (and
+;       (keymapp map)
+;       (progn
+;         (define-key map [separator-help] '("---"))
+;         (define-key map [open] '("Open add path" . ocaml-add-path ))
+;         (define-key map [close]
+;           '("Close module for help" . ocaml-close-module))
+;         (define-key map [open] '("Open module for help" . ocaml-open-module))
+;         (define-key map [help] '("Help for identifier" . caml-help))
+;         (define-key map [complete] '("Complete identifier" . caml-complete))
+;         )
+;    ))))
+
+
+(provide 'caml-help)

File .emacs.d/elpa/caml-20121015.1250/caml-hilit.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+; Highlighting patterns for hilit19 under caml-mode
+
+; defined also in caml.el
+(defvar caml-quote-char "'"
+  "*Quote for character constants. \"'\" for OCaml, \"`\" for Caml-Light.")
+
+(defconst caml-mode-patterns
+  (list
+;comments
+   '("\\(^\\|[^\"]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)"
+     2 comment)
+;string
+   (list 'hilit-string-find (string-to-char caml-quote-char) 'string)
+   (list (concat caml-quote-char "\\(\\\\\\([ntbr" caml-quote-char "\\]\\|"
+                 "[0-9][0-9][0-9]\\)\\|.\\)" caml-quote-char)
+         nil
+         'string)
+;labels
+   '("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]" 1 brown)
+   '("[~?][ (]*[a-z][a-zA-Z0-9_']*" nil brown)
+;modules
+   '("\\<\\(assert\\|open\\|include\\)\\>" nil brown)
+   '("`?\\<[A-Z][A-Za-z0-9_\']*\\>" nil MidnightBlue)
+;definition
+   (list (concat
+          "\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
+          "\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
+          "\\|in\\(herit\\)?\\|let\\|m\\(ethod\\|utable\\|odule\\)"
+          "\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
+          "\\|v\\(al\\|irtual\\)\\)\\>")
+         nil 'ForestGreen)
+;blocking
+   '("\\<\\(object\\|struct\\|sig\\|begin\\|end\\)\\>" 2 include)
+;control
+   (list (concat
+          "\\<\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|i\\(f\\|gnore\\)"
+          "\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)"
+          "\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\>"
+          "\\|\|\\|->\\|&\\|#")
+         nil 'keyword)
+   '(";" nil struct))
+  "Hilit19 patterns used for OCaml mode")
+
+(hilit-set-mode-patterns 'caml-mode caml-mode-patterns)
+(hilit-set-mode-patterns
+ 'inferior-caml-mode
+ (append
+  (list
+;inferior
+   '("^[#-]"    nil     firebrick))
+  caml-mode-patterns))
+
+(provide 'caml-hilit)

File .emacs.d/elpa/caml-20121015.1250/caml-pkg.el

+(define-package "caml" "20121015.1250" "OCaml code editing commands for Emacs [source: svn]" 'nil)
+

File .emacs.d/elpa/caml-20121015.1250/caml-types.el

+;(***********************************************************************)
+;(*                                                                     *)
+;(*                                OCaml                                *)
+;(*                                                                     *)
+;(*          Damien Doligez, projet Moscova, INRIA Rocquencourt         *)
+;(*                                                                     *)
+;(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+; An emacs-lisp complement to the "-annot" option of ocamlc and ocamlopt.
+
+;; XEmacs compatibility
+
+(eval-and-compile
+  (if (and (boundp 'running-xemacs) running-xemacs)
+      (require 'caml-xemacs)
+    (require 'caml-emacs)))
+
+
+
+(defvar caml-types-location-re nil "Regexp to parse *.annot files.
+
+Annotation files *.annot may be generated with the \"-annot\" option
+of ocamlc and ocamlopt.
+
+Their format is:
+
+  file ::= block *
+  block ::= position <SP> position <LF> annotation *
+  position ::= filename <SP> num <SP> num <SP> num
+  annotation ::= keyword open-paren <LF> <SP> <SP> data <LF> close-paren <LF>
+
+  <SP> is a space character (ASCII 0x20)
+  <LF> is a line-feed character (ASCII 0x0A)
+  num is a sequence of decimal digits
+  filename is a string with the lexical conventions of OCaml
+  open-paren is an open parenthesis (ASCII 0x28)
+  close-paren is a closed parenthesis (ASCII 0x29)
+  data is any sequence of characters where <LF> is always followed by
+       at least two space characters.
+
+- in each block, the two positions are respectively the start and the
+  end of the range described by the block.
+- in a position, the filename is the name of the file, the first num
+  is the line number, the second num is the offset of the beginning
+  of the line, the third num is the offset of the position itself.
+- the char number within the line is the difference between the third
+  and second nums.
+
+The current list of keywords is:
+type call ident"
+)
+
+(let* ((caml-types-filename-re "\"\\(\\([^\\\"]\\|\\\\.\\)*\\)\"")
+       (caml-types-number-re "\\([0-9]*\\)"))
+  (setq caml-types-position-re
+        (concat caml-types-filename-re " "
+                caml-types-number-re " "
+                caml-types-number-re " "
+                caml-types-number-re))
+  (setq caml-types-location-re
+        (concat "^" caml-types-position-re " " caml-types-position-re)))
+
+(defvar caml-types-expr-ovl (make-overlay 1 1))
+(make-face 'caml-types-expr-face)
+(set-face-doc-string 'caml-types-expr-face
+                     "face for hilighting expressions and types")
+(if (not (face-differs-from-default-p 'caml-types-expr-face))
+    (set-face-background 'caml-types-expr-face "#88FF44"))
+(overlay-put caml-types-expr-ovl 'face 'caml-types-expr-face)
+
+(defvar caml-types-typed-ovl (make-overlay 1 1))
+(make-face 'caml-types-typed-face)
+(set-face-doc-string 'caml-types-typed-face
+                     "face for hilighting typed expressions")
+(if (not (face-differs-from-default-p 'caml-types-typed-face))
+    (set-face-background 'caml-types-typed-face "#FF8844"))
+(overlay-put caml-types-typed-ovl 'face 'caml-types-typed-face)
+
+(defvar caml-types-scope-ovl (make-overlay 1 1))
+(make-face 'caml-types-scope-face)
+(set-face-doc-string 'caml-types-scope-face
+                     "face for hilighting variable scopes")
+(if (not (face-differs-from-default-p 'caml-types-scope-face))
+    (set-face-background 'caml-types-scope-face "#BBFFFF"))
+(overlay-put caml-types-scope-ovl 'face 'caml-types-scope-face)
+
+(defvar caml-types-def-ovl (make-overlay 1 1))
+(make-face 'caml-types-def-face)
+(set-face-doc-string 'caml-types-def-face
+                     "face for hilighting binding occurrences")
+(if (not (face-differs-from-default-p 'caml-types-def-face))
+    (set-face-background 'caml-types-def-face "#FF4444"))
+(overlay-put caml-types-def-ovl 'face 'caml-types-def-face)
+
+(defvar caml-types-occ-ovl (make-overlay 1 1))
+(make-face 'caml-types-occ-face)
+(set-face-doc-string 'caml-types-occ-face
+                     "face for hilighting variable occurrences")
+(if (not (face-differs-from-default-p 'caml-types-occ-face))
+    (set-face-background 'caml-types-occ-face "#44FF44"))
+(overlay-put caml-types-occ-ovl 'face 'caml-types-occ-face)
+
+
+(defvar caml-types-annotation-tree nil)
+(defvar caml-types-annotation-date nil)
+(make-variable-buffer-local 'caml-types-annotation-tree)
+(make-variable-buffer-local 'caml-types-annotation-date)
+
+(defvar caml-types-buffer-name "*caml-types*"
+  "Name of buffer for diplaying caml types")
+(defvar caml-types-buffer nil
+  "buffer for diplaying caml types")
+
+(defun caml-types-show-type (arg)
+  "Show the type of expression or pattern at point.
+   The smallest expression or pattern that contains point is
+   temporarily highlighted.  Its type is highlighted in the .annot
+   file and the mark is set to the beginning of the type.
+   The type is also displayed in the mini-buffer.
+
+   Hints on using the type display:
+   . If you want the type of an identifier, put point within any
+     occurrence of this identifier.
+   . If you want the result type of a function application, put point
+     at the first space after the function name.
+   . If you want the type of a list, put point on a bracket, on a
+     semicolon, or on the :: constructor.
+   . Even if type checking fails, you can still look at the types
+     in the file, up to where the type checker failed.
+
+Types are also displayed in the buffer *caml-types*, which is
+displayed when the command is called with Prefix argument 4.
+
+See also `caml-types-explore' for exploration by mouse dragging.
+See `caml-types-location-re' for annotation file format.
+"
+  (interactive "p")
+  (let* ((target-buf (current-buffer))
+         (target-file (file-name-nondirectory (buffer-file-name)))
+         (target-line (1+ (count-lines (point-min)
+                                       (caml-line-beginning-position))))
+         (target-bol (caml-line-beginning-position))
+         (target-cnum (point)))
+    (caml-types-preprocess (buffer-file-name))
+    (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
+    (let* ((targ-loc (vector target-file target-line target-bol target-cnum))
+           (node (caml-types-find-location targ-loc "type" ()
+                                           caml-types-annotation-tree)))
+      (cond
+       ((null node)
+         (delete-overlay caml-types-expr-ovl)
+         (message "Point is not within a typechecked expression or pattern."))
+       (t
+        (let ((left (caml-types-get-pos target-buf (elt node 0)))
+              (right (caml-types-get-pos target-buf (elt node 1)))
+              (type (cdr (assoc "type" (elt node 2)))))
+          (move-overlay caml-types-expr-ovl left right target-buf)
+          (with-current-buffer caml-types-buffer
+            (erase-buffer)
+            (insert type)
+            (message (format "type: %s" type)))
+          ))))
+    (if (and (= arg 4)
+             (not (window-live-p (get-buffer-window caml-types-buffer))))
+        (display-buffer caml-types-buffer))
+    (unwind-protect
+        (caml-sit-for 60)
+      (delete-overlay caml-types-expr-ovl)
+      )))
+
+(defun caml-types-show-call (arg)
+  "Show the kind of call at point.
+   The smallest function call that contains point is
+   temporarily highlighted.  Its kind is highlighted in the .annot
+   file and the mark is set to the beginning of the kind.
+   The kind is also displayed in the mini-buffer.
+
+The kind is also displayed in the buffer *caml-types*, which is
+displayed when the command is called with Prefix argument 4.
+
+See `caml-types-location-re' for annotation file format.
+"
+  (interactive "p")
+  (let* ((target-buf (current-buffer))
+         (target-file (file-name-nondirectory (buffer-file-name)))
+         (target-line (1+ (count-lines (point-min)
+                                       (caml-line-beginning-position))))
+         (target-bol (caml-line-beginning-position))
+         (target-cnum (point)))
+    (caml-types-preprocess (buffer-file-name))
+    (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
+    (let* ((targ-loc (vector target-file target-line target-bol target-cnum))
+           (node (caml-types-find-location targ-loc "call" ()
+                                           caml-types-annotation-tree)))
+      (cond
+       ((null node)
+         (delete-overlay caml-types-expr-ovl)
+         (message "Point is not within a function call."))
+       (t
+        (let ((left (caml-types-get-pos target-buf (elt node 0)))
+              (right (caml-types-get-pos target-buf (elt node 1)))
+              (kind (cdr (assoc "call" (elt node 2)))))
+          (move-overlay caml-types-expr-ovl left right target-buf)
+          (with-current-buffer caml-types-buffer