             (list "--no-build"))
           (when no-load
             (list "--no-load"))
-          (let ((dir (make-temp-file "intero" t)))
+          (let ((dir (intero-make-temp-file "intero" t)))
             (list "--ghci-options"
                   (concat "-odir=" dir)
                   "--ghci-options"

(defvar-local intero-temp-file-name nil
  "The name of a temporary file to which the current buffer's content is copied.")

(defun intero-temp-file-name (&optional buffer)
  "Return the name of a temp file containing an up-to-date copy of BUFFER's contents."
  (with-current-buffer (or buffer (current-buffer))

        (or intero-temp-file-name
            (setq intero-temp-file-name
                  (intero-canonicalize-path
                   (intero-make-temp-file "intero" nil ".hs"))))
      (let ((contents (buffer-string)))
        (with-temp-file intero-temp-file-name
          (insert contents))))))
