   "Set up a buffer for use with merlin."
   (interactive)
   (set (make-local-variable 'merlin-lock-point) (point-min))
-  (set (make-local-variable 'merlin-buffer) nil)
-  (set (make-local-variable 'merlin-result) nil)
-  (set (make-local-variable 'merlin-completion-point) nil)
-  (set (make-local-variable 'merlin-ready) nil)
-  (set (make-local-variable 'merlin-pending-errors) nil)
-  (set (make-local-variable 'merlin-pending-errors-overlays) nil)
-  (set (make-local-variable 'merlin-lock-zone-highlight-overlay) nil)
-  (set (make-local-variable 'merlin-lock-zone-margin-overlay) nil)
-  (set (make-local-variable 'merlin-project-file) nil)
-  (set (make-local-variable 'merlin-enclosing-types) nil)
-  (set (make-local-variable 'merlin-enclosing-offset) nil)
   ; if there is not yet a buffer for the current buffer, create one
   (when (not (merlin-process-started-p))
     (merlin-start-process merlin-current-flags))


(defvar merlin-result nil
  "Temporary variables to store command results.")

(defvar merlin-buffer nil "Buffer for merlin input.")

(defvar merlin-ready nil "If non-nil, the reception is done.")

;; Overlays
(defvar merlin-lock-zone-highlight-overlay nil
  "Overlay used for the lock zone highlighting.")
(defvar merlin-lock-zone-margin-overlay nil
  "Overlay used for the margin indicator of the lock zone.")

;; Errors related variables
(defvar merlin-pending-errors nil
  "Pending errors.")
(defvar merlin-lock-point 0
  "Position up to which merlin knows about.")
(defvar merlin-pending-errors-overlays nil
  "Overlays for the pending errors.")
(defvar merlin-highlight-overlay nil "Merlin overlay used for highlights.")

;; Completion related variables
(defvar merlin-completion-point nil
  "Stores the point of last completion (beginning of the prefix).")

; Vars from auto-complete
(defvar ac-point)

;; Type related variables
(defvar merlin-enclosing-types nil
  "List containing the enclosing type.")
(make-variable-buffer-local 'merlin-enclosing-types)
(defvar merlin-enclosing-offset nil
  "Current offset in `merlin-enclosing-types'.")
(make-variable-buffer-local 'merlin-enclosing-offset)

;; Locate
(defvar merlin-position-stack nil)

;; Misc
(defvar merlin-project-file nil
  "The .merlin file for current buffer.")
(make-variable-buffer-local 'merlin-project-file)


;;;;;;;;;;;
