 ;; BUFFER SYNCHRONIZATION ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(defun merlin-buffer-substring (start end)
+   "Return content of buffer between two-point or empty string if points are not valid"
+   (if (< start end)
+       (buffer-substring-no-properties start end)
+     ""))
+
 (defun merlin-drop ()
   "Drop the knowledge of merlin of the buffer after the current position."
   (merlin-send-command 'drop))


(defun merlin-ac-fetch-type ()
  "Prints the type of the selected candidate"
  (let ((candidate (buffer-substring-no-properties merlin-completion-point  (point))))
    (if merlin-completion-types
        (mapc
         (lambda (item)

      (progn (setq merlin-lock-point (1- start))
             (merlin-sync-lock-zone-display))))

(defun merlin-sync-to-point (&optional point)
  "Makes sure the buffer is synchronized on merlin-side and centered around (point)."
  (lexical-let
      ((point (if point point (point))))
    (merlin-tell-to-point point)
    (merlin-seek-exact point)
    (merlin-sync-lock-zone-display)))

;;;;;;;;;;;;;;;;;;
;; ERROR REPORT ;;
