   "Return the start and end points of an ocaml atom near point.
 An ocaml atom is any string containing [a-z_0-9A-Z`.]."
   (save-excursion
-    (skip-chars-backward "[a-z_0-9A-Z'`.]")
-    (skip-chars-backward "[~?]" (1- (point)))
-    (if (or (looking-at "['a-z_0-9A-Z`.]*['a-z_A-Z0-9]")
-            (looking-at "[~?]"))
+    (skip-chars-backward "[a-z_0-9A-Z'.]")
+    (skip-chars-backward "[~?`]" (1- (point)))
+    (if (or (looking-at "[~?`]?['a-z_0-9A-Z.]*['a-z_A-Z0-9]")
+            (looking-at "[~?`]"))
         (cons (point) (match-end 0)) ; returns the bounds
       nil))) ; no atom at point
 

                      (merlin--completion-format-entry entry)
                      (cdr (assoc 'kind entry))
                      (cdr (assoc 'info entry))))
              (append entries nil)))))

(defun merlin--completion-lookup (string state)
  "Lookup the entry STRING inside the completion table."

  merlin-ac-cache)

(defvar merlin-ac-source
  '((init . merlin-ac-source-init)
    (candidates . merlin-auto-complete-candidates)
    (action . merlin-ac-fetch-type)
    (prefix . merlin-ac-prefix)))

(when (featurep 'auto-complete)
  (eval '(ac-define-source "merlin" merlin-ac-source)))
