 (defun merlin-type-enclosing ()
   "Print the type of the expression under point (or of the region, if it exists)."
   (interactive)
+  (merlin-sync-to-point)
   (save-excursion
-    (merlin-sync-to-point)
     (if (region-active-p)
-        (merlin-type-region)
-      (when (merlin-type-enclosing-query)
+        (merlin--type-region)
+      (when (merlin--type-enclosing-query)
         (merlin-type-enclosing-go-up))))
   (when merlin-arrow-keys-type-enclosing
     (set-temporary-overlay-map merlin-type-enclosing-map t)))

  (interactive)
  (let ((point (point)))
    (merlin-sync-to-point)
    (if (equal point (merlin-phrase-goto 'current 0))
        (merlin-phrase-goto 'prev 0))))

(defun merlin-to-point ()
  "Update merlin to the current point, reporting errors."
  (interactive)
  (merlin-sync-to-point)
  (merlin-error-check t))

(defun merlin-to-end ()
  "Update merlin to the end-of-file, reporting errors."
  (interactive)
  (when merlin-mode
    (merlin-sync-to-point (point-max))
    (merlin-error-check t)))

(defun merlin-customize ()
  "Open the customize buffer for the group merlin."

;; LOCATE ;;
;;;;;;;;;;;;

(defun merlin--locate-pos (ident)
  "Locate the identifier IDENT at point and return the result."
  (merlin-send-command
   (list 'locate (substring-no-properties ident)
         'at (merlin-unmake-point (point)))))

(defun merlin--locate-pure (ident)
  "Locate the identifier IDENT at point."
  (let* ((r (merlin--locate-pos ident)))
    (if r
        (if (listp r)
            (merlin-goto-file-and-point r)
