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

  (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))
        (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.
This is actually the base name: the concrete Scheme
implementation name gets appended to it."
  :type 'filename
  :group 'geiser-repl)

