        (not (string-match "^,quit *$" str))))
 
 (defun geiser-repl--history-setup ()
-  (set (make-local-variable 'comint-input-ring-file-name) geiser-repl-history-filename)
+  (set (make-local-variable 'comint-input-ring-file-name)
+       (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)

  :group 'geiser-repl)

(defcustom geiser-repl-history-filename (expand-file-name "~/.geiser_history")
  "File where REPL input history is saved, so that it persists between sessions."
  :type 'filename
  :group 'geiser-repl)


  (when (string= event "finished\n")
    (with-current-buffer (process-buffer proc)
      (let ((comint-prompt-read-only nil)
            (comint-input-ring-file-name (geiser-repl--history-file)))
        (geiser-repl--on-quit)
        (when (buffer-name (current-buffer))
          (insert "\nIt's been nice interacting with you!\n")
