 
 (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 with basename `ocaml-info-basename' to look for. 
+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)

  "Does completion for qualified identifiers. 

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.


        (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)) module)
        (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)) default)
      (if (null modules) (error-message "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

