 
 ;; Look for identifiers around point
 
-(defun ocaml-current-position ()
-  "Return a pair (MODULE . ENTRY) such that point is above ENTRY and 
-MODULE is the module preceeding ENTRY.
-
-Both are a pair of position (BEG . END) in the buffer and can be nil if
-undefined."
+(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-Z][A-Za-z0-9_]*\\>\\.\\|[^.]\\)\\<[A-Za-z0-9_]*\\="
+           "[^A-Za-z0-9_.']\\([A-Za-z0-9_']*[.]\\)*[A-Za-z0-9_']*\\="
            (- (point) 100) t)
           (progn
-            (if (looking-at "\\<\\([A-Za-z_'][A-Za-z0-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-z_'][A-Za-z0-9_']*\\)\\>")
-                (progn (message "TROIS")
-                (setq entry (cons (match-beginning 1) (match-end 1)))))))
+            (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
 

          (error "Quit")))
     (t
      (if (= arg 0) (setq ocaml-visible-modules 'lazy))
      (let ((module-entry (ocaml-current-position)))
        (setq entry (ocaml-buffer-substring (cdr module-entry)))
        (setq module
              (or (ocaml-buffer-substring (car module-entry))

;; Info files


(defun ocaml-info-add-entries-old (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
