        ((null node)
         (delete-overlay caml-types-expr-ovl)
         (message "Point is not within a typechecked expression or pattern.")
-        (with-current-buffer type-buf (narrow-to-region 1 1)))
+        ; (with-current-buffer type-buf (narrow-to-region 1 1))
+        )
        (t
         (let ((left (caml-types-get-pos target-buf (elt node 0)))
               (right (caml-types-get-pos target-buf (elt node 1)))
-              (ty-start (car (elt node 2)))
-              (ty-end (cdr (elt node 2))))
+              (type (elt node 2)))
           (move-overlay caml-types-expr-ovl left right target-buf)
-          (with-current-buffer type-buf
-            (widen)
-            (message (format "type: %s" (buffer-substring ty-start
-                                                          (1- ty-end))))
-            (narrow-to-region ty-start ty-end))))))
+          (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 type-buf))))
-        (display-buffer type-buf))
+             (not (window-live-p (get-buffer-window caml-types-buffer))))
+        (display-buffer caml-types-buffer))
     (unwind-protect
         (sit-for 60)
       (delete-overlay caml-types-expr-ovl))))
 
-(defun caml-types-preprocess (type-file type-buf)
+(defun caml-types-preprocess (type-file)
   (let* ((type-date (nth 5 (file-attributes type-file)))
          (target-file (file-name-nondirectory (buffer-file-name)))
          (target-date (nth 5 (file-attributes target-file))))

;  () if this node does not correspond to an annotated interval
;  (type-start . type-end)  address of the annotation in the .annot file

(defun caml-types-build-tree (target-file)
  (let ((stack ())
        (accu ())
        (type-info ()))
    (while (re-search-forward caml-types-location-re () t)
      (let ((l-file (file-name-nondirectory (match-string 1)))

                  (move-overlay caml-types-expr-ovl Left Right target-buf)
                  (setq limits (caml-types-find-interval target-buf target-pos
                                                         node))
                  (setq type (elt node 2))
                  )
                 (t
                  (delete-overlay caml-types-expr-ovl)
                  (setq type "*no type information*")
                  (setq limits (caml-types-find-interval target-buf target-pos
                                                         tree))
                  ))
                (message (format "type: %s" type))
                (insert type)
                ))
              (setq event (read-event))
              (unless (mouse-movement-p event) (setq event nil))
            )
