   "Initialize merlin."
   (add-hook 'kill-buffer-hook 'merlin-kill-buffer-hook))
                                       
-(defun merlin-kill-all-buffers ()
+(defun merlin-kill-all-processes ()
   "Kill all the remaining buffers containing merlin processes"
   (interactive)
-  (merlin-kill-process))
+  (mapc '(lambda (p)
+           (with-current-buffer (process-buffer p)
+             (merlin-kill-process)))))
 
 (provide 'merlin)


(defun merlin-wait-for-answer ()
  "Waits for merlin to answer"
  (let ((times 0))
    (while
        (and (< times 20)
             (or
              (not (accept-process-output (merlin-get-process) 0.1 nil nil))
              (not merlin-ready)))
      (setq times (+ times 1)))
    (setq merlin-buffer nil)
    (setq merlin-ready nil)))

(defun merlin-start-process ()
  "Start the merlin process for the current buffer"



; Process / Reception related variables
(defvar merlin-processes nil
  "The global merlin process table. It lists the active instances of merlin")
(defvar merlin-local-process nil
  "The local merlin process (buffer local in every process buffer)"
)
