   (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-filename))
+            (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")

  :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)



;;; REPL history and clean-up:

(defsubst geiser-repl--history-file ()
  (format "%s.%s" geiser-repl-history-filename geiser-impl--implementation))

(defun geiser-repl--on-quit ()
  (comint-write-input-ring)
  (let ((cb (current-buffer))
