 (defun ems-stop ()
   (ems-teardown-bridge))
 
-(defun msg-me (process event)
-   (princ
-     (format "Process: %s had the event `%s'" process event)))
-
-(set-process-sentinel (get-buffer-process "*js*") 'msg-me)
-

;;; Currently testing!

(defvar ems-node-buffer nil)
(defvar ems-output-buffer nil)
(defvar ems-request-counter 0)

(defun ems-load-node ()
  (run-js inferior-js-program-command t)
  (setq ems-node-buffer (get-buffer "*js*"))
  (let ((output-buffer (get-buffer "*ems-output*")))
    (if output-buffer
        (setq ems-output-buffer output-buffer)
      (setq ems-output-buffer (generate-new-buffer "*ems-output*"))
      ))
  (ems-erase-output))

(defun ems-load-mathjax ()
  (comint-redirect-send-command-to-process

;; Input: A key value
(defun ems-move-walker (key)
  (let* ((counter (incf ems-request-counter))
         (command (format "console.log('BEGINOUTPUT%d:' + sre.move(%d) + 'ENDOUTPUT%d');"
             counter key counter)))
    (comint-redirect-send-command-to-process
     command
