   "Hold a table mapping completion cache for auto-complete.")
 (make-variable-buffer-local 'merlin-ac-cache)
 
+(defvar merlin-completion-at-point-cache-query (cons "" 0)
+  "The cache for calls to completion-at-point so that it does not
+trigger useless merlin calls.")
+(make-variable-buffer-local 'merlin-completion-at-point-cache-query)
+
+
 ;; Type related variables
 (defvar merlin-enclosing-types nil
   "List containing the enclosing type.")


(defun merlin-process-dead-p ()
  "Return non-nil if merlin process is dead."
  (and merlin-process
       (not (equal (process-status merlin-process) 'run))))

(defun merlin-lighter ()
  "Return the lighter for merlin which indicates the status of merlin process."
  (if (merlin-process-dead-p) " merlin(??)" " merlin"))

;;;###autoload


                   (substitute-command-keys "\\[merlin-pop-stack]")))
      (save-excursion (save-selected-window (funcall do-open))))))

(defun merlin-make-point (data)
  "Transform DATA (a remote merlin position) into a point."
  (save-excursion
