-;; merlin.el --- Mode for Merlin, an OCaml scriptable toplevel.   -*- coding: utf-8 -*-
-
+;; merlin.el --- Mode for Merlin, an OCaml scriptable toplevel.   -*- coding: utf-8 -*- 
 ;; Licensed under the MIT license.
 
 ;; Author: Simon Castellan <simon.castellan(_)iuwt.fr>

   "tell" (list mode (buffer-substring-no-properties start end))))

(defun merlin-tell-till (end)
   "Tell the region using mode MODE between START and END in several chunks (a chunk is at most 10 lines)."
   (save-excursion
     ;; tell lines 10 by 10
     (let ((curr (point)))
       (forward-line 10)
       (while (< (point) end)
	 (merlin-tell-piece "struct" curr (point))
	 (setq curr (point))
	 (forward-line 10))
       (merlin-tell-piece "struct" curr end))))

(defun merlin-tell-till-end-of-phrase ()
  "Tell merlin the buffer until the end of the current phrase is met.

    (define-key merlin-map (kbd "C-c C-u") 'merlin-refresh)
    (define-key merlin-map (kbd "C-c TAB") 'merlin-try-completion)
    (define-key merlin-map (kbd "C-c C-u") 'merlin-refresh)
    (define-key merlin-map (kbd "C-c t") 'merlin-type-enclosing)
    (define-key merlin-map (kbd "C-<up>") 'merlin-type-enclosing-go-up)
    (define-key merlin-map (kbd "C-<down>") 'merlin-type-enclosing-go-down)
    (define-key merlin-map (kbd "C-c C-n") 'merlin-next-phrase)
    (define-key merlin-map (kbd "C-c C-p") 'merlin-prev-phrase)
    (define-key merlin-menu-map [customize]
      '("Customize merlin-mode" . merlin-customize))
    (define-key merlin-menu-map [separator]
