Skip to content

Commit

Permalink
[wip] when no tempdir: try (clojure-project-dir) as fallback first
Browse files Browse the repository at this point in the history
  • Loading branch information
caadr committed Nov 13, 2023
1 parent b5f7a4d commit 5c1262a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cider-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,10 @@ Any other value is just returned."

(defun cider--make-nearby-temp-copy (file)
(with-demoted-errors "Failed to copy to temporary file:\n %s"
(let ((new-file (file-name-concat (temporary-file-directory)
(cider--make-temp-name file))))
(let* ((default-directory (or (clojure-project-dir) default-directory))
;; Note: (temporary-file-directory) uses `default-directory' as fallback.
(new-file (file-name-concat (temporary-file-directory)
(cider--make-temp-name file))))
(copy-file file new-file :exists-ok nil nil :keep-permissions)
new-file)))

Expand Down

0 comments on commit 5c1262a

Please sign in to comment.