 ;;; Geiser REPL buffers and processes:
 
 (defvar geiser-repl--repls nil)
+(defvar geiser-repl--closed-repls nil)
 
 (make-variable-buffer-local
  (defvar geiser-repl--repl nil))

       (geiser-repl--history-file))
  (set (make-local-variable 'comint-input-ring-size) geiser-repl-history-size)
  (set (make-local-variable 'comint-input-filter) 'geiser-repl--input-filter)
  (add-hook 'kill-buffer-hook 'geiser-repl--on-quit nil t)
  (comint-read-input-ring t)
  (set-process-sentinel (get-buffer-process (current-buffer)) 'geiser-repl--sentinel))


      (let ((comint-prompt-read-only nil)
            (comint-input-ring-file-name (geiser-repl--history-file)))
        (geiser-repl--on-quit)
        (push (current-buffer) geiser-repl--closed-repls)
        (when (buffer-name (current-buffer))
          (insert "\nIt's been nice interacting with you!\n")
          (insert "Press C-cz to bring me back.\n" ))))))

(defun geiser-repl--on-kill ()
  (geiser-repl--on-quit)
  (remove (current-buffer) geiser-repl--closed-repls))

(defun geiser-repl--input-filter (str)
  (and (not (string-match "^\\s *$" str))
