   (ac-define-source "merlin" merlin-ac-source))
 
 ;; Usual completion
+(defun merlin--completion-lookup (string state)
+  "Lookup the entry `STRING' inside the completion table."
+  (let ((ret (assoc string merlin--completion-annotation-table)))
+    (if ret
+        (message "%s%s" (car ret) (cdr ret)))))
 (defun merlin-completion-at-point ()
   (save-excursion
     (merlin-check-synchronize))

    (let ((start (point)))
      (skip-syntax-forward "w_.")
      (list start (point)
            (apply-partially #'merlin--completion-table start)))))

(defvar merlin--completion-cache-state nil)
(defvar merlin--completion-annotation-table nil

    (add-to-list 'ac-sources 'merlin-ac-source))
  (add-hook 'completion-at-point-functions
            #'merlin-completion-at-point nil 'local)
  (setq (make-local-variable 'completion-extra-properties) '(:exit-function (lambda (s status) (message "haha: %s" status))))
  (set (make-local-variable 'merlin-lock-point) (point-min))
  (set (make-local-variable 'merlin-buffer) nil)
  (set (make-local-variable 'merlin-result) nil)
