                               (concat output "\n" skewer-repl-prompt))))))
 
 (defun skewer-repl ()
+  "Start a JavaScript REPL to be evaluated in the visiting browser."
   (interactive)
   (when (not (get-buffer "*skewer-repl*"))
     (with-current-buffer (get-buffer-create "*skewer-repl*")

(require 'skewer-mode)

(defvar skewer-repl-prompt "js> ")

(defun skewer-repl-process ()
  (get-buffer-process (current-buffer)))

(define-derived-mode skewer-repl-mode comint-mode "js-REPL"
  :syntax-table emacs-lisp-mode-syntax-table
  (setq comint-prompt-regexp (concat "^" (regexp-quote skewer-repl-prompt)))
  (setq comint-input-sender 'skewer-input-sender)

    (set-process-filter (skewer-repl-process) 'comint-output-filter)))

(defun skewer-input-sender (proc input)
  "REPL comint handler."
  (skewer-eval input 'skewer-post-repl))

(defun skewer-post-repl (result)
  "Callback for reporting results in the REPL."
  (let ((buffer (get-buffer "*skewer-repl*"))
        (output (cdr (assoc 'value result))))
    (when buffer
