 
 (defun ocaml-add-mli-modules (modules tag &optional path)
   (let ((files
-         (ocaml-find-files (or path ocaml-lib-path)
+         (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)))
+                 (dirp (member dir (ocaml-lib-path))))
             (if (and (consp dirp) (string-equal dir (car dirp)))
                 (setq dir (car dirp)))
             (if (assoc module modules) nil

      (set-buffer (get-buffer-create "*caml-help*"))
      (setq command
            (concat "gunzip -c -f " files
                " | grep -e '" ocaml-info-section-regexp "'"))
      (message command)
      (or (shell-command command (current-buffer)) (error "HERE"))
      (goto-char (point-min))
      (while (re-search-forward ocaml-info-section-regexp (point-max) t)
        (let* ((module (match-string 2))
               (section (match-string 1)))
          (message "%s %s" module section)


;; 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 (re-search-backward
           "[^A-Za-z0-9_.']\\([A-Za-z0-9_']*[.]\\)*[A-Za-z0-9_']*\\="
           (- (point) 100) t)
          (progn
            (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-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

