 (defun merlin-type-expression (exp callback-if-success &optional callback-if-exn)
   "Get the type of EXP inside the local context."
   (if exp (merlin-send-command-async
-           (list 'type 'expression exp 'at (merlin-unmake-point (point)))
+           (list 'type 'expression (substring-no-properties exp)
+                 'at (merlin-unmake-point (point)))
            callback-if-success callback-if-exn)))
 
 (defun merlin-type-display (bounds type &optional quiet)

      (forward-line (1- line))
      (move-to-column col))))

(defun merlin-goto-file-and-point (data &optional same-buffer-force)
  "Go to the file and position indicated by DATA which is an assoc list containing fields file, line and col.
If SAME-BUFFER-FORCE is non-nil, create a new window even if it is the same buffer."
  (if (> (length (cdr (assoc 'file data))) 0)
      (find-file-other-window (cdr (assoc 'file data)))
    (when same-buffer-force
        (find-file-other-window buffer-file-name)))
  (merlin-goto-point (cdr (assoc 'pos data))))

(defun merlin-make-point (data)
  "Transform DATA (a couple line / col) into a point."

  (when (ac-menu-live-p)
    (when (popup-hidden-p ac-menu)
      (ac-show-menu))
    (let ((merlin-locate-in-new-window 'always))
      (merlin-locate-pure (ac-selected-candidate)))
    (ac-show-menu)))

(defun merlin-pop-stack ()
  "Go back to the last position where the user did a locate."
  (interactive)
  (let ((r (pop merlin-position-stack)))
    (cond ((not r) (message "empty stack"))
          ((equal merlin-locate-in-new-window 'never) 
           (switch-to-buffer (car r)))
          ((or (equal merlin-locate-in-new-window 'always)
               (not (equal (buffer-name) (car r))))
           (select-window (display-buffer (car r)))))
    (when r (goto-char (cdr r)))))
    
;;;;;;;;;;;;;;;;;;;;;;;
;; SEMANTIC MOVEMENT ;;
