 
 (defun merlin--document-pure (&optional ident)
   "Document the identifier IDENT at point."
-  (let ((r (merlin--document-pos ident)))
-    (message "%s" r)))
+  (let* ((raw-doc  (merlin--document-pos ident))
+         (doc      (concat "(*" raw-doc "*)"))
+         (nb-lines (merlin--count-lines doc)))
+    (merlin/display-in-type-buffer doc)
+    (if (> nb-lines 8)
+        (display-buffer merlin-type-buffer-name)
+      (message "%s"
+        (with-current-buffer merlin-type-buffer-name
+          (font-lock-fontify-region (point-min) (point-max))
+          (buffer-string))))))
 
 (defun merlin-document ()
   "Document the identifier under point"

    (insert text)
    (goto-char (point-min))))

(defun merlin--type-display (bounds type &optional quiet)
  "Display the type TYPE of the expression occuring at BOUNDS.
If QUIET is non nil, then an overlay and the merlin types can be used."
  (if (not type)
      (unless quiet (message "<no information>"))
    (let ((count 0)
          (pos   0))
      (merlin/display-in-type-buffer type)
      (while (and (<= count 8)
                  (string-match "\n" type pos))
        (setq pos (match-end 0))
        (setq count (1+ count)))
      (if (> count 8)
          (display-buffer merlin-type-buffer-name)
        (message "%s"

    (cons (if bounds (car bounds) (point))
          (point))))

;;;;;;;;;;;;;;;;;
;; TYPE BUFFER ;;
;;;;;;;;;;;;;;;;;

(defun merlin--count-lines (text)
  (let ((count 0)
        (pos   0))
    (while (and (<= count 8)
                (string-match "\n" text pos))
           (setq pos (match-end 0))
           (setq count (1+ count)))
    count))

(defun merlin/display-in-type-buffer (text)
  "Change content of type-buffer."
