From f7bb5a314ac235641f9a6548850c3592da4af7ed Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 26 Dec 2022 18:00:38 -0500 Subject: km/scratch-find-file: Don't hard code temp directory --- lisp/km-files.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/km-files.el b/lisp/km-files.el index 9e9edc3..762afe5 100644 --- a/lisp/km-files.el +++ b/lisp/km-files.el @@ -125,7 +125,7 @@ Prompt with characters from `km/find-scratch-buffers' to determine the extension of the scratch file. With prefix argument PWD, find the scratch file in -`default-directory' instead of /tmp." +`default-directory' instead of `temporary-file-directory'." (interactive "P") (switch-to-buffer (km/scratch--find-file-no-select pwd))) @@ -142,7 +142,8 @@ With prefix argument PWD, find the scratch file in (let* ((choices (mapcar #'car km/find-scratch-buffers)) (ch (read-char-choice (concat "[" choices "]") choices)) (ext (cadr (assq ch km/find-scratch-buffers)))) - (concat (if pwd default-directory "/tmp/") "scratch" ext))) + (expand-file-name (concat "scratch" ext) + (if pwd default-directory temporary-file-directory)))) (provide 'km-files) ;;; km-files.el ends here -- cgit v1.2.3