 where identifier is defined."
   (interactive "p")
   (let* ((module-entry (ocaml-qualified-identifier))
-         (module)
+         (module) 
          (entry (cdr module-entry))
          (beg) (end) (pattern))
     (if (car module-entry)
-        (setq module
-              (buffer-substring (caar module-entry) (cdar 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))

;; Loading or building databases.
;; 

(require 'info)

;; variables to be customized

(defvar ocaml-lib-path 'lazy

  "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.

